Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 501c634

Browse files
committed
Another update to README.md
1 parent 06b3c11 commit 501c634

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,36 @@ The library will search inside these folders in the following order:
8585
4. **module_location**/**module_name**/views/_master/
8686
5. **views_path**/_master/
8787

88+
## How to use?
89+
Load the library where you want to use or you can autoload it inside **autoload.php** file.
90+
91+
`$autoload['libraries'] = array('theme');`
92+
93+
In your controller, simple use library's method or chain them (ones that can be chained). Example (see: *controllers/Example.php*)
94+
95+
$this->theme
96+
->title('Title Goes Here')
97+
->add_css('added_css1', 'added_css2')
98+
->append_css('appended_css1'),
99+
->add_js('added_js1'),
100+
->append_js('appended_js1')
101+
->add_partial('header')
102+
->load('view_file', $data);
103+
104+
There is a short version of all this but in case you want to add partial views you have to use `$this->theme->add_partial()` before using the function.
105+
106+
$this->theme
107+
->add_partial('header')
108+
->add_partial('footer');
109+
110+
render('view_file', $data, 'Title Goes Here', array(
111+
// Available options.
112+
'css' => array('added_css1', 'added_css2'),
113+
'append_css' => 'appended_css1',
114+
'js' => 'added_js1',
115+
'append_js' => 'appended_js1',
116+
));
117+
88118
Feel free to explore the library to know more about it and if you have any questions, I am here to answer as long as I am still alive.
89119

90120
#CREDITS

0 commit comments

Comments
 (0)