An open API service indexing awesome lists of open source software.

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

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 )