PHP Classes

File: JUI/Jui.php

Recommend this page to a friend!
  Classes of Jakub Kuritka  >  PHP JUI templating system  >  JUI/Jui.php  >  Download  
File: JUI/Jui.php
Role: Auxiliary script
Content type: text/plain
Description: Application script
Class: PHP JUI templating system
Build HTML user interfaces from JSON definitions
Author: By
Last change: Now we are using YAML instead of JSON, but JSON serializer still exists, so it can be used
Date: 9 years ago
Size: 1,242 bytes


Class file image Download

 * @author Jakub Kuritka <>
 * @copyright (c) 2012, Jakub Kuritka
 * @license LGPL

define("JUI_DIR", dirname(__FILE__));
define("JUI_RESOURCES_FILE", dirname(dirname(__FILE__)) . "/Resources/resources.yaml");

 * Set it true while developing, otherwise set false,
 * because autoloader will generate class map everytime you run your appliaction

 * If you have your own autoloader, comment this line
require_once JUI_DIR . "/Autoloader/OPLAutoloader.php";

 * Create parser and Serializer
 * Visit JUI/Engine/Serializers dir for more serializers
$serializer = new \JUI\Engine\Serializers\Yaml();

$parser = new \JUI\Engine\Parser();

 * Create resources
$resources = new \JUI\Resources();
$resources->setParser($parser); //for components parsing
$resources->setSerializer($serializer); //for reading resources file
$resources->setFile(JUI_RESOURCES_FILE);//it will set file and automatically parse, so you have to set parser before calling this method.

 * Every component can acess resources calling $this->resources() method


For more information send a message to info at phpclasses dot org.