putJsContent Method

This method will be loaded a theme with javascript content from a theme file.

The $content_location value will be referred to a file name under app/view/THEME/.

This value also can contain path prefix of subdirectory before the filename.

Basic Usage

Here is the basic usage of putThemeContent method from SENE_Controller .

$this->putJsContent(string $content_location[, array $data=array()]): $this


Metode ini memiliki 1 paremeter wajib yaitu $content_location.


The $content_location value is a string indicates view component locations from current theme. This location value does not require .php suffix.


The $data value contains about array of array that passed to view. The array key will be parsed as native variable(s) on view.


Here is the example for putThemeContent method:

class Home extends SENE_Controller
  public function __construct()
  public function index()
    $data = array();

So, the homepage theme, col-1 layout and home_bottom.php content should be existed on the directory structure.

└── view/
 └── front/
  ├──  home/
  | ├──  slider.php
  | └──  three_values.php
  └──  page
    └──  col-1.php

Example home_bottom.php content

Here is the example code for home_bottom.php content

alert('Hi, this is from home_bottom');