本文整理汇总了PHP中Router::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::__construct方法的具体用法?PHP Router::__construct怎么用?PHP Router::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::__construct方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->rout = '';
$this->explodeUri();
/*
apenas para checagem dos caminhos
//echo '<p>ROUT FILE: '.$routFile.'</p>';
echo '<pre >';
echo '<p>ROTA COMPLETA: '.$this->getRoute().'</p>';
echo '<p>NOME Controller: '.$this->getController().'</p>';
echo '<p>NOME METODO: '.$this->getAction().'</p>';
echo '</pre>';
*/
if ($this->load->controller($this->getRoute() . $this->getController())) {
$_controller = $this->getController();
$action = $this->getAction();
if (method_exists($this->{$_controller}, $action)) {
$this->{$_controller}->{$action}();
} else {
$_message_error = "<p><strong>DESCULPE-NOS</strong></p>\n\t\t\t\t\t\t\t\t<p>A página que você procura não foi encontrada.</p>\n\t\t\t\t\t\t\t\t<p>Verifique o endereço digitado ou tente novamente mais tarde.</p>\n\t\t\t\t\t\t\t\t";
require_once BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . ERRORDIR . DIRECTORY_SEPARATOR . 'error_404.php';
}
} else {
$_message_error = "<p><strong>DESCULPE-NOS</strong></p>\n\t\t\t\t\t\t\t\t<p>A página que você procura não foi encontrada.</p>\n\t\t\t\t\t\t\t\t<p>Verifique o endereço digitado ou tente novamente mais tarde.</p>";
require_once BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . ERRORDIR . DIRECTORY_SEPARATOR . 'error_404.php';
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
self::loadPluginRoutes();
if (Config::get("urlRewriting")) {
self::addRewrites(CODE_ROOT_DIR . "config/rewrite.php");
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
require_once 'define.php';
Session::init();
define('CONTROLLER_PATH', APP_PATH . Router::$dir . DS . 'controller' . DS);
define('VIEWS_PATH', APP_PATH . Router::$dir . DS . 'views' . DS);
define('INCLUDE_PATH', APP_PATH . Router::$dir . DS . 'include' . DS);
define('LAYOUT_PATH', VIEWS_PATH . 'layout' . DS);
define('WIDGET_PATH', VIEWS_PATH . 'widget' . DS);
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->sapi['cli']['__DEFAULT__'] = array('file' => PLATFORM_PATH . 'cli.php', 'class' => 'CliHelp');
$this->sapi['cli']['indexer'] = array('class' => 'LensIndexer', 'description' => 'Launch the continual indexing process');
$this->sapi['cli']['create'] = array('class' => 'LensCreate', 'description' => 'Create a new event sink');
$this->sapi['cli']['event'] = array('class' => 'LensEvent', 'description' => 'Log a new event to a sink');
$this->sapi['cli']['add-index'] = array('class' => 'LensAddIndex', 'description' => 'Create a new index on a sink');
$this->sapi['cli']['reindex'] = array('class' => 'LensReindex', 'description' => 'Re-index events in a sink');
$this->sapi['cli']['add-group'] = array('class' => 'LensAddGroup', 'description' => 'Create a new aggregate on a sink');
$this->sapi['cli']['sinks'] = array('class' => 'LensListSinks', 'description' => 'List available event sinks');
}
示例5: define
function __construct()
{
parent::__construct();
// which object are we accessing?
define('OBJECT', 'exhibit');
$find['obj_ref_type'] = OBJECT;
$this->object = $this->db->selectArray('object_meta', $find, Db::FETCH_RECORD);
// library of $_POST options
$submits = array('upd_view', 'img_upload', 'publish_x', 'add_page', 'delete_x', 'publish_page', 'upd_ord', 'upd_img_ord', 'upd_section', 'upd_cbox', 'upd_settings', 'upd_delete', 'unpublish_x', 'del_bg_img', 'bg_img_upload', 'upd_jxs', 'upd_jximg', 'upd_jxdelimg', 'upd_jxtext', 'add_sec', 'del_sec', 'edit_sec');
// from $_POST to method
$this->posted($this, $submits);
}
示例6: __construct
public function __construct($host, $src, $dst, $mthd = null, $args = null)
{
parent::__construct($src, $dst, $mthd, $args);
$this->host = $host;
}
示例7: __construct
/**
* Constructs a new V2_1Router
*
* @param array $config
* @param array $rules
*/
public function __construct($version, array $config, array $rules = array())
{
parent::__construct($config);
$this->version = $version;
$this->rules = $rules;
}
示例8: __construct
/**
* @param \OCP\ICache $cache
*/
public function __construct($cache)
{
$this->cache = $cache;
parent::__construct();
}
示例9: __construct
/**
* Constructs a new Router
*
* @param array $config The application configuration
*/
public function __construct(array $config, array $routers, array $oldVersions)
{
parent::__construct($config);
$this->setRouters($routers);
$this->oldVersions = $oldVersions;
}
示例10: __construct
/**
* Automatically adds a configuration handler.
*/
public function __construct()
{
parent::__construct();
$this->handler(new Handlers\Configure());
$this->initialize();
}
示例11: __construct
protected function __construct()
{
parent::__construct();
$this->resolvePage();
}
示例12:
function __construct()
{
parent::__construct();
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->_appConfig = Registry::get('main', 'config');
$this->setType($this->_appConfig->get('frontend_router_type'));
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->initialize();
}