Ejemplo n.º 1
0
function load($name, $type = '', $data = array())
{
    static $loader = NULL;
    if (is_null($loader)) {
        include 'autoload.php';
        $loader = Loader::get_instance();
    }
    return $loader->default_class($name, $type, $data);
}
Ejemplo n.º 2
0
 /**
  * Enable the Ajax mode.
  * If you call this function the Loader class, will print the output of the controller
  * without loading any Layout.
  *
  */
 function ajax_mode($load_javascript = false, $load_style = false, $load_layout = false)
 {
     $loader = Loader::get_instance();
     $loader->ajax_mode($load_javascript, $load_style, $load_layout);
 }
Ejemplo n.º 3
0
<?php

require_once LIBRARY_DIR . "Loader.php";
$loader = Loader::get_instance();
$loader->init_settings();
//load the settings
$loader->init_db();
$loader->init_session();
$loader->init_language();
//set the language
//$loader->auth_user();
$loader->init_theme();
//set theme
$loader->init_js();
#--------------------------------
# Auto Load the Controller
# init_route set the controller/action/params
# to load the controller
#--------------------------------
$loader->auto_load_controller();
#--------------------------------
# Load model
# load the model and assign the result
# @params model, action, params, assign_to
#--------------------------------
$loader->load_menu();
#--------------------------------
# Assign Layout variables
#--------------------------------
$loader->assign('title', 'RainFramework');
#--------------------------------
Ejemplo n.º 4
0
 protected function send($action, $data = array(), $method = 'get')
 {
     $result = Loader::get_instance()->api->send($action, $data, $method);
     return array('log' => $result);
 }