本文整理汇总了PHP中loader::load方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::load方法的具体用法?PHP loader::load怎么用?PHP loader::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loader
的用法示例。
在下文中一共展示了loader::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loader
function __construct()
{
require_once 'functions/loader.php';
$loader = new loader();
$config = $loader->load('configuration');
switch ($config->api_provider()) {
case 'coinbase':
$this->provider = $loader->load('coinbaseapi');
break;
default:
echo '<div class="errormsg">The API provided is not valid, please set up a valid API provider in the configuration.</div>';
$this->provider = new fakeapi();
break;
}
}
示例2: __get
private function __get($var)
{
if ($var == "params") {
return $this->params;
}
return loader::load($var);
}
示例3: addScalableButtonCSS
public function addScalableButtonCSS()
{
$basepath = base::baseUrl();
echo "<style type=\"text/css\"> @import \"{$basepath}/core/styles/btn.php\"; </style>";
$lib = loader::load("library");
$lib->jsm->loadButtonJS();
}
示例4: render
public function render()
{
$id = $this->options['id'];
$type = $this->options['type'];
$data = $this->options['data'];
$style = $this->options['style'];
$class = $this->options['class'];
$callback = $this->options['callback'];
$name = $this->options['name'];
$theme = $this->options['theme'];
$refreshinterval = $this->options['refreshinterval'];
$position = $this->options['position'];
if ($type == "text" || $type == "html") {
//process text based widgets
$output = "<div id='{$id}' class='widget {$class}' style='{$style}'>";
if (!empty($name)) {
$output .= "<h2 class='widgettitle'>{$name}</h2>";
}
$output .= "<div class='widgetdata'>{$data}</div>";
$output .= "</div>";
} else {
if ($type == "rss") {
$url = $data;
$config = loader::load("config");
$googleApiKey = $config->google_api;
$output = "\n\t\t\t\t\n\t\t\t\t<div id='{$id}' class='widget {$class}' style='{$style}'>\n\t\t\t\t<h2 class='widgettitle'>{$name}</h2>\n\t\t\t\t<div class='widgetdata'>\n\t\t\t\t<script type=\"text/javascript\" src=\"http://www.google.com/jsapi?key={$googleApiKey}\"></script>\n\t\t\t <script type=\"text/javascript\">\n\t\t\t\t \$('#{$id}').gFeed({ \n\t\t\t\t url: '{$data}', \n\t\t\t\t title: ''\n\t\t\t\t }); \n\t\t\t </script>\n\t\t\t </div>\n\t\t\t ";
}
}
return $output;
}
示例5: __get
private function __get($model)
{
$_model = $model;
$model .= "model";
$modelfile = "app/models/{$model}.php";
$this->nullmodel = false;
//echo getcwd();
if (!file_exists($modelfile)) {
$this->nullmodel = true;
$modelfile = "core/models/nullmodel.php";
}
$config = loader::load("config");
if (file_exists($modelfile)) {
include_once $modelfile;
if (empty($this->loaded[$model])) {
if (!$this->nullmodel) {
$this->loaded[$model] = new $model();
} else {
$this->loaded[$model] = new nullmodel($_model);
}
}
$modelobj = $this->loaded[$model];
if ($config->auto_model_association) {
$post = array_merge($_POST, $_GET);
$strictness = $config->auto_model_association_strict;
$this->associate($modelobj, $post, $strictness);
//auto association
}
return $modelobj;
} else {
throw new Exception("Model {$model} is not found");
}
}
示例6: loader
function __construct()
{
require_once 'functions/loader.php';
$loader = new loader();
$config = $loader->load('configuration');
require_once 'functions/classes/coinbase/Coinbase.php';
$this->provider = Coinbase::withApiKey($config->api_key(), $config->api_secret());
}
示例7: setUp
public static function setUp()
{
$config = loader::load("config");
if ($config->unit_test_enabled) {
self::$results = array();
self::$testmode = true;
}
}
示例8: loader
function __construct()
{
require_once 'functions/loader.php';
$loader = new loader();
$config = $loader->load('configuration');
$this->key = $config->api_key();
$this->coin = $config->coin_code();
}
示例9: loader
function __construct()
{
$loader = new loader();
$this->api = $loader->load('selectapi');
$this->template = $loader->load('template');
$this->config = $loader->load('configuration');
$this->log = $loader->load('log');
$this->_message = '';
$this->_hasMessage = false;
if (isset($_GET['next'])) {
if ($this->validate()) {
$useraddr = $_POST['address'];
$amount = $this->config->faucet_amount();
$this->sendMoney($useraddr, $amount);
}
}
}
示例10: logIP
function logIP()
{
$time = time();
require_once 'functions/loader.php';
$loader = new loader();
$config = $loader->load('configuration');
$ip = $_SERVER[$config->ip_forward()];
$this->saveLog($ip, $time);
}
示例11: base
public function base()
{
$this->use_view = false;
echo "Hello";
$session = loader::load("session");
echo $session->name2;
$session->name2 = "abcd44dm44444";
//echo $session->name2;
}
示例12: addTechnorati
function addTechnorati()
{
$title = urlencode($title);
$docUrl = urlencode(getCurrentURL());
$url = "http://www.technorati.com/faves?add={$docUrl}";
$image = loader::load("image");
$bookmarkimage = $image->displayImageWithAlt("technorati.png", "Bookmark this page on StumbleUpon", null, null, $url, "_blank", true);
return $bookmarkimage;
}
示例13: __construct
/**
* Constructor, used if you're not calling the class statically
*
* @param string $accessKey Access key
* @param string $secretKey Secret key
* @param boolean $useSSL Whether or not to use SSL
* @return void
*/
public function __construct($accessKey = null, $secretKey = null, $useSSL = true)
{
$config = loader::load("config");
$key = $config->s3_key;
$secret = $config->s3_secret;
if (empty($key) || empty($secret)) {
throw new Exception("Please check your configuration file. Either S3 key or S3 secret is empty.");
}
self::setAuth($key, $secret);
}
示例14: base
function base()
{
$this->use_view = false;
$cache = loader::load("cache");
$cache->set("abcd", "Hello World", 2);
$cache->set("abcd2", "Hello World2", 5);
sleep(3);
if ($cache->isExpired("abcd")) {
echo "This key has been expired after 2 seconds";
}
echo $cache->get("abcd") . ":" . $cache->get("abcd2");
}
示例15: __construct
public function __construct()
{
global $debug;
if (file_exists("app/config/routes.php")) {
include_once "app/config/routes.php";
}
$path = array_keys($_GET);
$config = loader::load("config");
if (!isset($path[0])) {
$default_controller = $config->default_controller;
if (!empty($default_controller)) {
$path[0] = $default_controller;
} else {
$path[0] = "index";
}
}
$route = $path[0];
$sanitzing_pattern = $config->allowed_url_chars;
$route = preg_replace($sanitzing_pattern, "", $route);
$route = str_replace("^", "", $route);
$this->route = $route;
//echo $route;
$routParts = split("/", $route);
$this->controller = $routParts[0];
$this->action = isset($routParts[1]) ? $routParts[1] : "base";
array_shift($routParts);
array_shift($routParts);
$this->params = $routParts;
/* match user defined routing pattern */
if (isset($routes)) {
foreach ($routes as $_route) {
$_pattern = "~{$_route[0]}~";
$_destination = $_route[1];
if (preg_match($_pattern, $route)) {
$newroute = preg_replace($_pattern, "{$_destination}", $route);
//$newrouteparts = split("/",$_destination);
$newrouteparts = split("/", $newroute);
//base::pr($newrouteparts);
$this->controller = $newrouteparts[0];
$this->action = $newrouteparts[1];
array_shift($newrouteparts);
array_shift($newrouteparts);
$this->params = $newrouteparts;
break;
}
}
}
if ($this->params[count($this->params) - 1] == "debug") {
$debug = true;
//die(Debug);
}
}