Example #1
0
    function inherit()
    {
        return $this;
    }
    function take()
    {
        return $this;
    }
}
function field($key, $config)
{
    $field = new Field();
    $field->config = array_merge(array('key' => $key, 'property' => $property), $config);
    return $field;
}
$modules = new pluggable();
$modules->plug(new kv($modules));
class module extends pluggable
{
    var $fields = array();
    function prompt($field)
    {
        $this->fields = array_merge($this->fields, array($field));
        return $this;
    }
    function __construct()
    {
        $this->plug(new kv($this));
    }
    function run()
    {
Example #2
0
<?php

$widgets = new pluggable();
$widgets->plug(new kv($widgets));
function widget($name)
{
    global $widgets;
    $template = $widgets->get($name);
    $widget = new widget($template->all());
    return $widget;
}
class widget extends pluggable
{
    function __construct($data = null)
    {
        $this->plug(new kv($this, $data));
    }
    function __toString()
    {
        return $this->get('dom')->__toString();
    }
}
class dom
{
    var $children = array();
    var $css = array();
    var $attrs = array();
    var $jsCalls = array();
    var $singular = false;
    static $singulars = array();
    static $jsFiles = array('toggler' => 'http://localhost/~keeyipchan/tinyTinyFw/_lib/tinyTinyFw.controls.js');
<?php

/** 
 * Thư viện xử lý plugin
 * Vị trí : hm_include/pluggable.php 
 */
if (!defined('BASEPATH')) {
    exit('403');
}
/** Định nghĩa đường dẫn đến thư mục plugin */
define('PLUGIN_URI', SITE_URL . FOLDER_PATH . HM_PLUGIN_DIR . '/');
/**
 * Gọi thư viện pluggable
 */
require_once BASEPATH . HM_INC . '/pluggable/hm_pluggable.php';
/**
 * Khởi tạo class
 */
$hmpluggable = new pluggable();
/**
 * Chạy pluggable
 */
$hmpluggable->run_plugin();