Documentation:Autoload

From TinyMVC Documentation

Jump to: navigation, search

Autoloading Plugins

Instead of using $this->load->library() and $this->load->script() in your controllers, you can have them autoloaded. Then they are always available to every controller.

myapp/configs/config_autoload.php

/* auto-loaded libraries */
$config['libraries'] = array('mylib','myotherlib');
 
/* auto-loaded scripts */
$config['scripts'] = array('myhelpers','myscripts');

Just add your plugins to the autoload arrays.

If you want to alias an autoloaded library, use an array:

/* auto-loaded libraries */
$config['libraries'] = array(
  array('mylib','myalias'),
  array('myotherlib','otheralias')
  );
Personal tools