本文整理汇总了PHP中Loader::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::get_instance方法的具体用法?PHP Loader::get_instance怎么用?PHP Loader::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::get_instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
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);
}
示例2: ajax_mode
/**
* 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);
}
示例3:
<?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');
#--------------------------------
示例4: send
protected function send($action, $data = array(), $method = 'get')
{
$result = Loader::get_instance()->api->send($action, $data, $method);
return array('log' => $result);
}