Lets say I have multiple classes, organized in seperate files in the classes folder. But lets say I have a class to handle all my "news" related business, such as adding, editing, etc. And then I have my template engine which handles obvious thing.
Now lets say in my news class I need to output something to be parsed, is there a proper way to use my templating class without have to re-declare it?
I have tried declaring all my classes on my index page, which then includes the request pages, but it seems the declaring has to be done on each individual page that I use the particular class on. I hope this makes sense.
let me make it visual for those of you that don'tn like reading
Code: Select all
<?php
class news {
function add {}
function shownews{
$template = new template();
$template->var(array('header' => 'blah' ));
}
}
?>