public function __construct(array $options) { parent::__construct($options); $this->routes['default_symfony'] = new sfRoute('/symfony/:action/*', array('module' => 'default')); $this->routes['default_index'] = new sfRoute('/:module', array('action' => 'index')); $this->routes['default'] = new opDeprecatedRoute('/:module/:action/*'); }
/** * Constructor. * * @param array $options An array of options */ public function __construct(array $options) { parent::__construct($options); if (!isset($this->options['model'])) { throw new InvalidArgumentException(sprintf('You must pass a "model" option to %s ("%s" route)', get_class($this), $this->options['name'])); } $this->options = array_merge(array( 'actions' => false, 'module' => $this->options['name'], 'prefix_path' => '/'.$this->options['name'], 'column' => isset($this->options['column']) ? $this->options['column'] : 'id', 'with_show' => true, 'segment_names' => array('edit' => 'edit', 'new' => 'new'), 'model_methods' => array(), 'requirements' => array(), 'with_wildcard_routes' => false, 'default_params' => array(), ), $this->options); $this->options['requirements'] = array_merge(array($this->options['column'] => 'id' == $this->options['column'] ? '\d+' : null), $this->options['requirements']); $this->options['model_methods'] = array_merge(array('list' => null, 'object' => null), $this->options['model_methods']); if (isset($this->options['route_class'])) { $this->routeClass = $this->options['route_class']; } $this->generateRoutes(); }
public function __construct($options) { if (empty($options['rules'])) { $options['rules'] = array_keys($this->templates); } if (empty($options['model'])) { throw new InvalidArgumentException('You must pass a "model" option.'); } $options['name'] = $options['model']; parent::__construct($options); $this->generateRoutes(); }
/** * Constructor. * * @param array $options An array of options */ public function __construct(array $options) { parent::__construct($options); if (!isset($this->options['model'])) { throw new InvalidArgumentException('You must pass a "model" option to sfObjectRouteCollection'); } $this->options = array_merge(array('actions' => false, 'module' => $this->options['name'], 'prefix_path' => '/' . $this->options['name'], 'column' => isset($this->options['column']) ? $this->options['column'] : 'id', 'with_show' => true, 'segment_names' => array('edit' => 'edit', 'new' => 'new'), 'model_methods' => array()), $this->options); $this->options['requirements'] = array_merge(array($this->options['column'] => '\\d+'), $this->options['requirements']); $this->options['model_methods'] = array_merge(array('list' => null, 'object' => null), $this->options['model_methods']); if (isset($this->options['route_class'])) { $this->routeClass = $this->options['route_class']; } $this->generateRoutes(); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('twitter_post' => new sfRequestRoute('/twitter/post', array('module' => 'twitter', 'action' => 'post'), array('sf_method' => array('post'))), 'twitter_login' => new sfRoute('/twitter/login', array('module' => 'twitter', 'action' => 'login'), array(), array('extra_parameters_as_query_string' => true)), 'twitter_nodefaults' => new sfRoute('/twitter/*', array('module' => 'default', 'action' => 'error'))); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('vote_list' => new sfRequestRoute('/vote', array('module' => 'vote', 'action' => 'index'), array('sf_method' => array('get'))), 'vote_new' => new sfRequestRoute('/vote/new', array('module' => 'vote', 'action' => 'new'), array('sf_method' => array('get'))), 'vote_create' => new sfRequestRoute('/vote/create', array('module' => 'vote', 'action' => 'create'), array('sf_method' => array('post'))), 'vote_edit' => new sfDoctrineRoute('/vote/edit/:id', array('module' => 'vote', 'action' => 'edit'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_update' => new sfDoctrineRoute('/vote/update/:id', array('module' => 'vote', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_show' => new sfDoctrineRoute('/vote/show/:id', array('module' => 'vote', 'action' => 'show'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_post' => new sfDoctrineRoute('/vote/post/:id', array('module' => 'vote', 'action' => 'post'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_delete_confirm' => new sfDoctrineRoute('/vote/delete/:id', array('module' => 'vote', 'action' => 'deleteConfirm'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_delete' => new sfDoctrineRoute('/vote/delete/:id', array('module' => 'vote', 'action' => 'delete'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'VoteQuestion', 'type' => 'object')), 'vote_nodefaults' => new sfRoute('/vote/*', array('module' => 'default', 'action' => 'error'))); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('bbs_index' => new sfRoute('/bbs', array('module' => 'bbs', 'action' => 'index')), 'bbs_search' => new sfRoute('/bbs/search', array('module' => 'bbs', 'action' => 'search'), array(), array('extra_parameters_as_query_string' => true)), 'bbs_list' => new sfRoute('/bbs/list', array('module' => 'bbs', 'action' => 'list'), array(), array('extra_parameters_as_query_string' => true)), 'bbs_show' => new sfDoctrineRoute('/bbs/:id', array('module' => 'bbs', 'action' => 'show'), array('id' => '\\d+'), array('model' => 'Bbs', 'type' => 'object')), 'bbs_comment_history' => new sfRoute('/bbs/comment/history', array('module' => 'bbsComment', 'action' => 'history'), array(), array('extra_parameters_as_query_string' => true)), 'bbs_new' => new sfRoute('/bbs/new', array('module' => 'bbs', 'action' => 'new')), 'bbs_create' => new sfRequestRoute('/bbs/create', array('module' => 'bbs', 'action' => 'create'), array('sf_method' => array('post'))), 'bbs_edit' => new sfDoctrineRoute('/bbs/edit/:id', array('module' => 'bbs', 'action' => 'edit'), array('id' => '\\d+'), array('model' => 'Bbs', 'type' => 'object')), 'bbs_update' => new sfDoctrineRoute('/bbs/update/:id', array('module' => 'bbs', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Bbs', 'type' => 'object')), 'bbs_delete_confirm' => new sfDoctrineRoute('/bbs/deleteConfirm/:id', array('module' => 'bbs', 'action' => 'deleteConfirm'), array('id' => '\\d+'), array('model' => 'Bbs', 'type' => 'object')), 'bbs_delete' => new sfDoctrineRoute('/bbs/delete/:id', array('module' => 'bbs', 'action' => 'delete'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Bbs', 'type' => 'object')), 'bbs_comment_create' => new sfDoctrineRoute('/bbs/:id/comment/create', array('module' => 'bbsComment', 'action' => 'create'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Bbs', 'type' => 'object')), 'bbs_comment_delete_confirm' => new sfDoctrineRoute('/bbs/comment/deleteConfirm/:id', array('module' => 'bbsComment', 'action' => 'deleteConfirm'), array('id' => '\\d+'), array('model' => 'BbsComment', 'type' => 'object')), 'bbs_comment_delete' => new sfDoctrineRoute('/bbs/comment/delete/:id', array('module' => 'bbsComment', 'action' => 'delete'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'BbsComment', 'type' => 'object')), 'bbs_nodefaults' => new sfRoute('/bbs/*', array('module' => 'default', 'action' => 'error'))); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('ranking' => new sfRoute('/ranking', array('module' => 'ranking', 'action' => 'show')), 'ranking_access' => new sfRoute('/ranking/access', array('module' => 'ranking', 'action' => 'show', 'type' => 'access')), 'ranking_friend' => new sfRoute('/ranking/friend', array('module' => 'ranking', 'action' => 'show', 'type' => 'friend')), 'ranking_community' => new sfRoute('/ranking/community', array('module' => 'ranking', 'action' => 'show', 'type' => 'community')), 'ranking_topic' => new sfRoute('/ranking/topic', array('module' => 'ranking', 'action' => 'show', 'type' => 'topic')), 'ranking_default' => new sfRoute('/ranking/*', array('module' => 'default', 'action' => 'error'))); }
public function __construct(array $options) { parent::__construct($options); $this->routes = $this->generateRoutes(); $this->routes += $this->generateNoDefaults(); }
public function __construct(array $options) { parent::__construct($options); $this->generateRoutes($options['name']); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('chatroom_list' => new sfRequestRoute('/chat', array('module' => 'chat', 'action' => 'index'), array('sf_method' => array('get'))), 'chatroom_new' => new sfRequestRoute('/chat/new', array('module' => 'chat', 'action' => 'new'), array('sf_method' => array('get'))), 'chatroom_create' => new sfRequestRoute('/chat/create', array('module' => 'chat', 'action' => 'create'), array('sf_method' => array('post'))), 'chatroom_edit' => new sfDoctrineRoute('/chat/edit/:id', array('module' => 'chat', 'action' => 'edit'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_update' => new sfDoctrineRoute('/chat/update/:id', array('module' => 'chat', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_login' => new sfDoctrineRoute('/chat/login/:id', array('module' => 'chat', 'action' => 'login'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_logout' => new sfDoctrineRoute('/chat/logout/:id', array('module' => 'chat', 'action' => 'logout'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_show' => new sfDoctrineRoute('/chat/show/:id', array('module' => 'chat', 'action' => 'show'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_post' => new sfDoctrineRoute('/chat/post/:id', array('module' => 'chat', 'action' => 'post'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_heartbeat' => new sfDoctrineRoute('/chat/heartbeat/:id', array('module' => 'chat', 'action' => 'heartbeat'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_close_confirm' => new sfDoctrineRoute('/chat/close/:id', array('module' => 'chat', 'action' => 'closeConfirm'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_close' => new sfDoctrineRoute('/chat/close/:id', array('module' => 'chat', 'action' => 'close'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'ChatRoom', 'type' => 'object')), 'chatroom_log' => new sfDoctrineRoute('/chat/log/:id', array('module' => 'chat', 'action' => 'log'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'ChatRoom', 'type' => 'object')), 'chat_nodefaults' => new sfRoute('/chat/*', array('module' => 'default', 'action' => 'error'))); }
public function __construct(array $options) { parent::__construct($options); $this->routes = array('mtviewer_top' => new sfRequestRoute('/mtviewer', array('module' => 'mtviewer', 'action' => 'index')), 'mtviewer_member_list' => new sfDoctrineRoute('/mtviewer/member', array('module' => 'mtviewer_member', 'action' => 'list'), array('sf_method' => array('get')), array('model' => 'Op2Member', 'type' => 'list')), 'mtviewer_member_diary' => new sfDoctrineRoute('/mtviewer/member/:id/diary', array('module' => 'mtviewer_diary', 'action' => 'list'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2Member', 'type' => 'object')), 'mtviewer_diary' => new sfDoctrineRoute('/mtviewer/diary/show/:id', array('module' => 'mtviewer_diary', 'action' => 'show'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2Diary', 'type' => 'object')), 'mtviewer_diary_edit' => new sfDoctrineRoute('/mtviewer/diary/edit/:id', array('module' => 'mtviewer_diary', 'action' => 'edit'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2Diary', 'type' => 'object')), 'mtviewer_diary_update' => new sfDoctrineRoute('/mtviewer/diary/edit/:id', array('module' => 'mtviewer_diary', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Op2Diary', 'type' => 'object')), 'mtviewer_community_list' => new sfDoctrineRoute('/mtviewer/community', array('module' => 'mtviewer_community', 'action' => 'list'), array('sf_method' => array('get')), array('model' => 'Op2Community', 'type' => 'list')), 'mtviewer_community_topic' => new sfDoctrineRoute('/mtviewer/community/:id/topic', array('module' => 'mtviewer_topic', 'action' => 'list'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2Community', 'type' => 'object')), 'mtviewer_topic' => new sfDoctrineRoute('/mtviewer/topic/show/:id', array('module' => 'mtviewer_topic', 'action' => 'show'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2CommunityTopic', 'type' => 'object')), 'mtviewer_topic_edit' => new sfDoctrineRoute('/mtviewer/topic/edit/:id', array('module' => 'mtviewer_topic', 'action' => 'edit'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2CommunityTopic', 'type' => 'object')), 'mtviewer_topic_update' => new sfDoctrineRoute('/mtviewer/topic/edit/:id', array('module' => 'mtviewer_topic', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Op2CommunityTopic', 'type' => 'object')), 'mtviewer_community_event' => new sfDoctrineRoute('/mtviewer/community/:id/event', array('module' => 'mtviewer_event', 'action' => 'list'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2Community', 'type' => 'object')), 'mtviewer_event' => new sfDoctrineRoute('/mtviewer/event/show/:id', array('module' => 'mtviewer_event', 'action' => 'show'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2CommunityEvent', 'type' => 'object')), 'mtviewer_event_edit' => new sfDoctrineRoute('/mtviewer/event/edit/:id', array('module' => 'mtviewer_event', 'action' => 'edit'), array('id' => '\\d+', 'sf_method' => array('get')), array('model' => 'Op2CommunityEvent', 'type' => 'object')), 'mtviewer_event_update' => new sfDoctrineRoute('/mtviewer/event/edit/:id', array('module' => 'mtviewer_event', 'action' => 'update'), array('id' => '\\d+', 'sf_method' => array('post')), array('model' => 'Op2CommunityEvent', 'type' => 'object')), 'mtviewer_import_diary' => new sfRequestRoute('/mtviewer/import/diary', array('module' => 'mtviewer_diary', 'action' => 'import'), array('sf_method' => array('get', 'post'))), 'mtviewer_import_topic' => new sfDoctrineRoute('/mtviewer/import/topic/:id', array('module' => 'mtviewer_topic', 'action' => 'import'), array('id' => '\\d+', 'sf_method' => array('get', 'post')), array('model' => 'Community', 'type' => 'object'))); }