开发者

Templating System and Plugin System

How to create template/theme system and plugin system for a custom CMS similar to Wordpress or joomla?

Edit:

I don't wa开发者_StackOverflow中文版nt to use any templating engine similar to wordpress; a reason why it is famous for templating.


if you're looking to build a custom CMS why don't you pick a php framework and build on top of it. Why build from scratch when you an start with a proven and tested framework. Codeigniter is dead simple and Yii has already built a plugin system into its framework via components and modules: http://www.yiiframework.com/doc/guide/basics.module

Unless you're just trying to learn for yourself, there's really no benefit to building from scratch.


$varArray = array('firstVar' => 'the value', 'secondVar' => 255);
$varArray['theThirdVar'] = 12345;
foreach($varArray as $name => $value){
    $$name = $value;
}
include ('templates/template.php');

in the template.php then do something like:

<?echo $firstVar;?>

this then should give you the Value

EDIT: This is a minimal example. You also could take a look into codeigniter source. They also use this kindo of Template System.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜