putJsFooter Method

The putJsFooter method purpose is for loading JavaScript file by add (inject) SCRIPT tag into getJsFooter method from a controller.

Basic Usage

Here is the basic usage for putJsFooter method from SENE_Controller class.

$this->putJsFooter(string $jsfile_location[, int $utype=0]): $this

Parameters

This method has 1 required parameter and 1 optional parameter.

$jsfile_location

The $jsfile_location value can be string that point to a javascript filename with its location prefix, like URL.

$utype

The $utype value can be an integer, if false or 0 its relative to current BASE_URL. Otherwise, it will point to exact location that provide in the $jsfile_location value.

Example

Here is the example for putJsFooter method in a controller.

class Home extends SENE_Controller
{
  public function __construct()
  {
    parent::__construct();
    $this->setTheme('homepage');
  }
  public function index()
  {
    $data = array();
    $this->putThemeContent('home/home',$data);
    $this->putJsFooter($this->cdn_url('skin/front/js/app.js'), 1);
    $this->loadLayout('col-1',$data);
    $this->render();
  }
}