App

class App

App is the object that is a life-supply function for all of your views. App can either implement features on it’s own or rely on a Full Stack PHP framework (or Application) that incapsulates Agile UI.

$app = new App();
App::terminate(output)

Used when application flow needs to be terminated preemptievely. For example when call-back is triggered and need to respond with some JSON.

Execution state

property App::$is_rendering

Will be true if application is currently rendering recursively through the Render Tree.

Includes

App::requireJS($url)

Method to include additional JavaScript file in page:

$app->requireJS('https://code.jquery.com/jquery-3.1.1.js');
$app->requireJS('https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.js');

Using of CDN servers is always better than storing external libraries locally. Most of the time CDN servers are faster (cached) and more reliable.

App::requireCSS($url)

Method to include additional CSS stylesheet in page:

$app->requireCSS('http://semantic-ui.com/dist/semantic.css');

Hooks

Application implements HookTrait (http://agile-core.readthedocs.io/en/develop/hook.html) and the following hooks are available:

  • beforeRender
  • beforeOutput