Kevin Smith
Kevin Smith

Reputation: 731

Developing a template library

I'm attempting to develop my own template library because I've looked at quite a few and they just do more than what I need. I'd like to be able to use assets and themes as well as modules into my template library.

The best one I've found was Phil Sturgeon's that he uses for PyroCMS. I'd like to develop something close to this but there's more than I need there.

My main thing is to find one that can handle themes, modules, and asset using.

Upvotes: 0

Views: 92

Answers (2)

Shaolin
Shaolin

Reputation: 2551

  1. Copy Template.php file to libraries folder from the package you downloaded.

  2. Copy template.php file to config folder

  3. Have you templates under views/templates

  4. Edit the template.php (config file) as below

    //Default Template Configuration (adjust this or create your own)
    //Default template - This is the Main template
    
    $template['default']['template'] = 'template/template';
    $template['default']['regions'] = array('menu','content','title');
    
    $template['default']['parser'] = 'parser';
    $template['default']['parser_method'] = 'parse';
    $template['default']['parse_template'] = TRUE;
    
    
    
    //Login Template
    $template['login']['template'] = 'template/template_login';
    $template['login']['regions'] = array('content');
    
    $template['login']['parser'] = 'parser';
    $template['login']['parser_method'] = 'parse';
    $template['login']['parse_template'] = TRUE;
    

This is the basic configuration, If you want more info on how to send data from views, let me know

Upvotes: 2

Erman Belegu
Erman Belegu

Reputation: 4079

One other idea for you is CodeIgniter Template.

Here you have the link: http://williamsconcepts.com/ci/codeigniter/libraries/template/reference.html

You can download, read the documentation and create your own template easly.

Upvotes: 1

Related Questions