本文整理匯總了PHP中Alias::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Alias::factory方法的具體用法?PHP Alias::factory怎麽用?PHP Alias::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Alias
的用法示例。
在下文中一共展示了Alias::factory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle_item_before_update_form_parse
/**
* before parse form
*
* @param Model $model
* @param Form $form
*/
public function handle_item_before_update_form_parse($data)
{
// if there is only a global alias
// get that an show it in the form
if ($this->_settings->get('alias.global') == TRUE) {
$data->form->value('alias', Alias::factory(Website::instance()->id())->uris(array('controller' => $this->_controller, 'action' => 'view', 'id' => $data->model->id), FALSE));
}
}
開發者ID:yubinchen18,項目名稱:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代碼行數:14,代碼來源:Item.php
示例2: array
*/
Route::set('access', 'access/<token>(/<controller>(/<action>(/<id>(/<param1>))))')->defaults(array('token' => '', 'controller' => 'Home', 'action' => 'index'));
/**
* INTERNAL SUBREQUEST
*/
Route::set('internal', 'internal_<controller>(@<action>(:<id>))', array('controller' => '[a-zA-Z0-9\\_\\-]+', 'action' => '[a-zA-Z0-9\\_\\-]+'))->defaults(array('action' => 'index'));
/**
* LOCAL ALIAS NEWS
*/
Route::set('news', '(website_<website>/)actueel/<id>', array('website' => $websites_pattern))->defaults(array('controller' => 'News', 'action' => 'view'));
/**
* LOCAL ALIAS EVENT
*/
Route::set('event', '(website_<website>/)agenda/<id>', array('website' => $websites_pattern))->defaults(array('controller' => 'Event', 'action' => 'view'));
/**
* ALIAS
*/
// cache aliases
Alias::cache(Cache::instance('alias'));
Route::set('alias', '(website_<website>(/))(<uri>)', array('website' => $websites_pattern, 'uri' => '[a-zA-Z0-9\\-]+'))->filter(function ($route, $params, $request) {
if (isset($params['uri']) && $params['uri'] != '') {
$aliasParams = Alias::factory()->params($params['uri'], Website::instance()->uri($request->uri())->id());
return $aliasParams ? $aliasParams : FALSE;
} else {
return FALSE;
}
});
/**
* FRONTEND
*/
Route::set('frontend', '(website_<website>(/))(<controller>(/<action>(/<id>(/<param1>(/<param2>(/<param3>))))))(?<query>)', array('website' => $websites_pattern))->defaults(array('controller' => 'Page', 'action' => 'view'));
開發者ID:yubinchen18,項目名稱:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代碼行數:31,代碼來源:routes.php