/** * 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)); } }
*/ 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'));