当前位置: 首页>>代码示例>>PHP>>正文


PHP loader::load方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:15,代码来源:selectapi.php

示例2: __get

 private function __get($var)
 {
     if ($var == "params") {
         return $this->params;
     }
     return loader::load($var);
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:7,代码来源:controller.php

示例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();
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:7,代码来源:cssm.php

示例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;
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:30,代码来源:widgets.php

示例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");
     }
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:33,代码来源:model.php

示例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());
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:8,代码来源:coinbaseapi.php

示例7: setUp

 public static function setUp()
 {
     $config = loader::load("config");
     if ($config->unit_test_enabled) {
         self::$results = array();
         self::$testmode = true;
     }
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:8,代码来源:unittest.php

示例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();
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:8,代码来源:coinarea.php

示例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);
         }
     }
 }
开发者ID:girino,项目名称:StarterFaucet,代码行数:17,代码来源:main.php

示例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);
 }
开发者ID:girino,项目名称:StarterFaucet,代码行数:9,代码来源:log.php

示例11: base

 public function base()
 {
     $this->use_view = false;
     echo "Hello";
     $session = loader::load("session");
     echo $session->name2;
     $session->name2 = "abcd44dm44444";
     //echo $session->name2;
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:9,代码来源:sessionm.php

示例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;
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:9,代码来源:bookmark.php

示例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);
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:18,代码来源:s3.php

示例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");
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:12,代码来源:cachetest.php

示例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);
     }
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:52,代码来源:router.php


注:本文中的loader::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。