rofl90 Posted September 29, 2008 Share Posted September 29, 2008 Hi guys. First of all, I hope this doesn't sound like a "do it for me" thread, I'm really having trouble thinking about how I should do this. What I'd like to do is have a Template class that builds the top half of the page, (that has php in it), as a constructor, but I want it to take into account a few things, for instance, I'd like to create an array by doing this, in fact, I'll give a page that I'd like to be the creator: <?php define('ROOT_PATH', dirname(__FILE__).'/../../..'); include BASE_PATH.'/source/globals/core.php'; $tpl = new Template('PUBLIC', 'myTitle', 'myPath', 'myKeywords', 'myDesc', 'stdMenu'); $tpl->extra_meta[] = 'name, val'; // I don't fully know how this could work... $tpl->extra_js[] = "specialJs.js"; $tpl->extra_css[] = "specialCss.css"; $tpl->overrideSkin("superSecretSkin") // finds superSecretSkin.tpl, which possibly could have like a {@content} for where to put the defined (and rendered (SS)) in there. define('CONTENT', BASEPATH . '/source/' . LANGUAGE . '/site/page.php'); // This page will be included in the content (between the top and bottom half), this must be able to do use php, it will be like echoing, and loops, basic stuff. // hardcore php goes here //<insert some mysql interaction to get a loop>, then use a foreach() in content. include(BASEPATH./source/templates/'.SKIN); ?> So, I'm not crazy about anything too fancy. But could you just give me some logic I can work off of? Link to comment https://forums.phpfreaks.com/topic/126326-template-class-logic/ Share on other sites More sharing options...
rofl90 Posted September 29, 2008 Author Share Posted September 29, 2008 I should also mention, I don't care about caching. Link to comment https://forums.phpfreaks.com/topic/126326-template-class-logic/#findComment-653310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.