JasonBaier / ci3-fire-starter

NOW THAT CODEIGNITER 4 HAS BEEN RELEASED, THIS PROJECT WILL NOT BE UPDATED ANYMORE. CI3 Fire Starter is a CodeIgniter3 skeleton application that includes jQuery and Twitter Bootstrap. It is intended to be light weight, minimalistic and not get in your way of building great CodeIgniter 3 applications.
MIT License
153 stars 152 forks source link

add simple themes function #10

Closed arif-rh closed 9 years ago

arif-rh commented 9 years ago

_add_css_theme( $css_files )_

This function used to easily add css files to be included in a template. With this function, we can just add css name as parameter and it will use default css path in active theme.

We can add one or more css files as parameter, either as string or array. If using parameter as string, it must use comma separator between css file name.

Example:

 1. Using string as parameter
     $this->add_css_theme( "bootstrap.min.css, style.css, admin.css" );

 2. Using array as parameter
     $this->add_css_theme( array( "bootstrap.min.css", "style.css", "admin.css" ) );

_add_js_theme( $js_files )_

This function used to easily add js files to be included in a template. With this function, we can just add js name as parameter and it will use default js path in active theme.

We can add one or more js files as parameter, either as string or array. If using parameter as string, it must use comma separator between js file name.

Example:

 1. Using string as parameter
     $this->add_js_theme( "jquery-1.11.1.min.js, bootstrap.min.js, another.js" );

 2. Using array as parameter
     $this->add_js_theme( array( "jquery-1.11.1.min.js", "bootstrap.min.js,", "another.js" ) );

With return as chained object we can simply do like this:

$this
    ->add_css_theme( "bootstrap.min.css, style.css, admin.css" )
    ->add_js_theme( "jquery-1.11.1.min.js, bootstrap.min.js, another.js" );
JasonBaier commented 9 years ago

I like it! Can you do the same for the jsi18n files? Also, can you update the readme file to reflect the new methods?

arif-rh commented 9 years ago

I'd loved to do the same for the jsi18n files and update the readme.

Now I still prepare another simple function to add css or js from out of active theme folder, after I pull this and colud be merge, I will update the readme.

arif-rh commented 9 years ago

I have added function for jsi18n file and updated the README