https://github.com/appleboy/codeigniter-template
A Lightweight Codeigniter Template Libray
https://github.com/appleboy/codeigniter-template
Last synced: 6 months ago
JSON representation
A Lightweight Codeigniter Template Libray
- Host: GitHub
- URL: https://github.com/appleboy/codeigniter-template
- Owner: appleboy
- Created: 2012-01-26T04:33:20.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2015-10-17T04:59:55.000Z (about 10 years ago)
- Last Synced: 2025-04-10T08:31:34.887Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 234 KB
- Stars: 21
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkd
Awesome Lists containing this project
README
# Requirements
* CodeIgniter 2.0.0+
* PHP 5.2.0+
# Install via sparks
$ php tools/spark install -v1.0.4 codeigniter-template
# Usage
copy file into correct directory.
$ cp config/template.php application/config/
$ cp libraries/template.php application/libraries/
you can reference layout example file (template/layout.php)
Set default template layout and put layout file into `application/views` directory
$config['template_layout'] = 'template/layout';
Initialize template library
$this->load->library("template");
add css path
$this->template->add_css("http://xxxx/index.js", "screen");
add javascript path(put the file on bottom if the second parameter is set true, default is false)
$this->template->add_js("/asset/js/index.js", TRUE);
add meta tag
$this->template->add_meta_tag("og:title", "Test Title", 'property');
// it will output
$this->template->add_meta_tag("keywords", "some keywords");
// it will output
add title segment
$this->template->add_title_segment("test");
// it render output
test | your site title
render output (return output data if the second parameter is set true)
$this->template->render("index");
# Copyright
Copyright (C) 2014 Bo-Yi Wu ( appleboy AT gmail.com )