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


PHP base::pr方法代码示例

本文整理汇总了PHP中base::pr方法的典型用法代码示例。如果您正苦于以下问题:PHP base::pr方法的具体用法?PHP base::pr怎么用?PHP base::pr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在base的用法示例。


在下文中一共展示了base::pr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbtest

 public function dbtest()
 {
     //$this->use_layout = false;
     //$this->db->hi(1,2,3,4);
     //$this->db->execute("create table posts(id INTEGER, name TEXT)");
     //$this->db->execute("insert into posts (id, name) values (null, 'afif')");
     $this->db->execute("select * from posts");
     $this->db->execute("select * from destinations");
     $this->db->execute("select * from posts");
     $this->db->execute("select * from posts");
     $this->db->execute("select * from posts_destinations");
     $this->db->execute("select * from posts");
     $tc = $this->db->count();
     while ($row = $this->db->getRow()) {
         base::pr($row);
     }
     $this->db->rewind();
     $tc = $this->db->count();
     while ($row = $this->db->getRow()) {
         base::pr($row);
     }
     //base::pr($row);
     $this->view->set("count", $tc);
     //die();
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:25,代码来源:welcome.php

示例2: dispatch

 public static function dispatch($router)
 {
     global $app, $debug, $debugparts;
     ob_start();
     $config = loader::load("config");
     if ($config->session_auto_start) {
         $session = loader::load("session");
         //if (isset($_REQUEST['PHPSESSID'])) {
         //session_id($_REQUEST['PHPSESSID']);
         //}
         $session->start();
     }
     $char_encoding = $config->char_encoding;
     if (empty($char_encoding)) {
         $char_encoding = "utf-8";
     }
     header("Content-Type: text/html; charset={$char_encoding}");
     if ($config->global_profile) {
         $start = microtime(true);
     }
     $controller = $router->getController();
     $action = $router->getAction();
     $params = $router->getParams();
     if (count($params) >= 1) {
         if ("unittest" == $params[count($params) - 1] || '1' == $_POST['unittest']) {
             unittest::setUp();
         }
     }
     $redirect = true;
     while ($redirect) {
         $controllerfile = "app/controllers/{$controller}.php";
         if (!file_exists($controllerfile)) {
             //check for catch_all_controller
             $catchAllController = $config->catch_all_controller;
             if (empty($catchAllController)) {
                 throw new Exception("Controller [{$controller}] not found. Referrer was {$_SERVER['HTTP_REFERER']}");
             } else {
                 //here the fun begins
                 $_controller = $controller;
                 $controller = $catchAllController;
                 $controllerfile = "app/controllers/{$controller}.php";
             }
         }
         require_once $controllerfile;
         $app = new $controller($params);
         if ($catchAllController) {
             $app->catchAllController = $_controller;
             $app->catchAllAction = $action;
             $action = "catchAll";
         }
         $helper = loader::load("helper");
         $cm = $helper->common;
         //load the common helper from app directory
         $app->setParams($params);
         $app->setPostParams($router->getPostParams());
         //add pre action hook execution
         $preActionHooks = $app->getPreActionHooks();
         if (!empty($preActionHooks)) {
             foreach ($preActionHooks as $preHook) {
                 $app->{$preHook}();
             }
         }
         //execute the action
         $app->use_layout = $config->use_layout;
         $app->{$action}();
         //add post action hook execution
         $postActionHooks = $app->getPostActionHooks();
         if (!empty($postActionHooks)) {
             foreach ($postActionHooks as $postHook) {
                 $app->{$postHook}();
             }
         }
         //check if the controller calls for a redirect
         if (empty($app->redirectcontroller)) {
             $redirect = false;
         } else {
             //die("called a redirect");
             $controller = $app->redirectcontroller;
             $action = $app->redirectaction;
             $params = $app->params;
             $postparams = $app->post;
             $app->redirectcontroller = "";
             $app->redirectaction = "";
             if (!empty($params)) {
                 $app->params = $params;
             }
             if (!empty($postparams)) {
                 $app->post = $postparams;
             }
         }
         //end redirect processing
     }
     unittest::tearDown();
     $rawoutput = ob_get_clean();
     //manage view
     ob_start();
     $view = loader::load("view");
     $view->set("_errors", $app->getError());
     $viewvars = $view->getVars($app);
     $uselayout = $app->use_layout;
//.........这里部分代码省略.........
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:101,代码来源:dispatcher.php


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