waifung0207 / ci_bootstrap_3

A multi-tenant website template based on CodeIgniter 3 with integration of some useful tools
MIT License
385 stars 315 forks source link

embedded scripts position #44

Closed webacers closed 8 years ago

webacers commented 8 years ago

Is there any way to handle embedded scripts like this as it was handled previously? <?php $this->start('scripts_foot'); ?> // <?php

waifung0207 commented 8 years ago

Unfortunately I have removed the Plates template recently, to make the repo more closer to CodeIgniter style (and avoid developer to learn new stuff unnecessarily).

However I have implemented some logic to maintain the flexibility when embed scripts & stylesheets.

To embed scripts / stylesheets globally, you can update config/site.php and put the files under 'scripts' or 'stylesheets'.

To embed scripts / stylesheets on separate pages, you can make use of add_script() and add_stylesheet() functions to append or prepend the files.

For example, you may code like this in a controller:

public function index()
{
    $this->add_script('assets/js/custom_script.js');
    $this->render('home');
}
mastercho commented 8 years ago

add_script() and add_stylesheet() functions is still working?

waifung0207 commented 8 years ago

@mastercho yes they should still work, you can find them from MY_Controller file