├── README.md ├── config ├── autoload.php └── template.php ├── demo ├── controllers │ └── welcome.php ├── views │ ├── hero.php │ ├── news.php │ ├── template.php │ └── widgets │ │ └── navigation.php └── widgets │ └── navigation.php ├── libraries └── Template.php └── spark.info /README.md: -------------------------------------------------------------------------------- 1 | CodeIgniter Template Library 2 | ============================ 3 | 4 | This template library for Codeigniter lets you build complex templates using partial views and widgets. It's built with the same method chaining support that we are seeing so often in Codeigniter so it feels familiar. This library loads a template file that uses partial views. These partial view sections are internally represented by Partial Objects managed by the template library. These objects let you modify their content in a user friendly way through method chaining. 5 | 6 | Installation 7 | ------------ 8 | 9 | Copy the files to the corresponding folder in your application folder (or use spark). 10 | 11 | Configuration 12 | ------------- 13 | 14 | In your template.php config file you can change following configuration parameters (optional): 15 | 16 | /* 17 | | ------------------------------------------------------------------- 18 | | Template configuration 19 | | ------------------------------------------------------------------- 20 | | This file will contain the settings for the template library. 21 | | 22 | | 'parser' = if you want your main template file to be parsed, set to TRUE 23 | | 'template' = the filename of the default template file 24 | | 'cache_ttl' = the time all partials should be cache in seconds, 0 means no global caching 25 | */ 26 | 27 | $config['parser'] = FALSE; 28 | $config['template'] = 'template'; 29 | $config['cache_ttl'] = 0; 30 | 31 | If you prefer, you can autoload the library by adjusting your autoload.php file and add 'template' to the $autoload['libraries'] array. 32 | 33 | Template files 34 | -------------- 35 | 36 | Template files are loaded or parsed by Codeigniter and the partials are passed to them as data. You can easily load them like you would normally use data in your view files: 37 | 38 |
39 |This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.
4 | 5 |Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
5 | 6 | 7 |Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
11 | 12 |Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
17 | 18 |