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


PHP Routes::run方法代码示例

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


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

示例1: StartApp

		public static function StartApp()
		{
			ob_start('ob_gzhandler');
			session_start();
			
			// Defines
			define('BASEURL', substr((empty($_SERVER['HTTPS']) ? 'http://' : 'https://' ) . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'],0,-10));
			define('BASEPATH', substr($_SERVER['SCRIPT_FILENAME'],0,-10));
			
			// Helper Boot Loader
			require(BASEPATH.'/core/bootloader.php');
			
			// Initialize Helpers
			BootLoader::loadHelpers();
			Registry::getInstance();
			
			// Handle Errors
			Registry::setDebugMode(true);
			set_error_handler('Template::handleError');
			set_exception_handler('Template::handleException');
	
			// Initialize Database
			Model::$db = DBO::getInstance('sqlite:example.sqldb');
			
			// Init Autoloads
			spl_autoload_register('Autoload::controllers');
			spl_autoload_register('Autoload::models');
			
			// Determine Controllers and Methods
			Routes::getRoute();
			
			// Run Application
			Routes::run();
		}
开发者ID:nickbarth,项目名称:PHP-Tofu,代码行数:34,代码来源:index.php

示例2: run

 function run()
 {
     $config = parse_ini_file('../.config');
     $this->setUpDb();
     $showErrors = isset($config['showErrors']) ? $config['showErrors'] : false;
     $configuration = ['settings' => ['displayErrorDetails' => $showErrors]];
     $c = new \Slim\Container($configuration);
     // create new Slim instance
     $app = new \Slim\App($c);
     // create new Slim instance
     //$app = new \Slim\App();
     $app->db = $this->database;
     $this->flashDB(false);
     $app->auth = false;
     $app->user = '';
     $app->register = $config['registerActive'];
     $app->add(function ($request, $response, $next) use(&$app) {
         if (isset($_SESSION['userID'])) {
             $app->auth = true;
             $app->user = $_SESSION['username'];
         }
         $response = $next($request, $response);
         return $response;
     });
     $container = $app->getContainer();
     $container['view'] = function ($c) {
         // templates location and a settings array
         $view = new \Slim\Views\Twig('../templates', ['cache' => '../cache', 'auto_reload' => true, 'debug' => true]);
         // Instantiate and add Slim specific extension
         $view->addExtension(new Slim\Views\TwigExtension($c['router'], $c['request']->getUri()));
         return $view;
     };
     $route = new Routes($app);
     $app = $route->run($app);
     $this->app = $app;
     // Run app
     $this->app->run();
 }
开发者ID:rath3r,项目名称:rath3rapi,代码行数:38,代码来源:bootstrap.php

示例3:

<?php

// Load up the framework
require_once 'core/autoload.php';
// Run the current route
Routes::run();
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:6,代码来源:index.php

示例4: ini

 public static function ini()
 {
     include_once "../app/Routes.php";
     Routes::run();
 }
开发者ID:amineabri,项目名称:Fiesta,代码行数:5,代码来源:Routes.php


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