getJsReady Method

The getJsReady method will get injected javascript that espsecially built for use inside document ready block from putJsReady method.

Basic Usage

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

$this->getJsReady(): void


This method has no parameter required.

Example Usage

Usually this method called inside a layout file. Here is the basic example for getJsReady method. Here is the content of col-1.php layout file.

<!DOCTYPE html>
    <?php $this->getJsReady(); ?>

Here is the full file and directory structures.

└── controller/
| └── home.php
└── view/
 ├── front/
 | ├── home/
 | └── home_bottom.php
 └── page/
   └── col-1.php

Here is the content of home.php controller file.

class Home extends SENE_Controller
  public function __construct()
  public function index()
    $data = array();
    $data['admin_name'] = 'Daeng';

Here is the content of home_bottom.php embedded javascript file.

alert('<?php echo $admin_name?>');

The $data variable that passed into putJsContent method, has been extracted into native variable depending on key name of array.

In this case, the $data['admin_name'] converted into $admin_name if called inside home_bottom.php file.

The putThemeContent, putJsContent, and render method(s) has ability for buffered the html view.