Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Allow selecting the TranslatorAwareTreeRouteStack via configuration #4630

Conversation

weierophinney
Copy link
Member

Per the mailing list, there's currently no way to opt-in to using the TranslatorAwareTreeRouteStack without overwriting the "Router" service. This PR fixes that situation, by allowing a new configuration item inside the router configuration, "router_class", which allows you to specify the router to use. The factory will then invoke that class' factory() method to retrieve an instance. This can be done for either console or HTTP router types.

return array(
    'console' => array(
        'router' => array(
            'router_class' => 'My\Custom\Console\Router',
            'routes' => array( /* ... */ ),
        ),
    ),
    'router' => array(
        'router_class' => 'My\Custom\Http\Router',
        'routes' => array( /* ... */ ),
    ),
);

- Allows usage of TranslatorAwareTreeRouteStack via configuration now:

  'router' => array(
      'route_class' => 'Zend\Mvc\Router\Http\TranslatorAwareTreeRouteStack',
      'routes' => array( /* ... */ )
  )

- Also possible to use alternate console routers this way
@ghost ghost assigned DASPRiD Jun 11, 2013
*/
public function assemble(array $params = array(), array $options = array())
{
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line missing after closing brace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@weierophinney
Copy link
Member Author

@DASPRiD ping -- added the line.

mwillbanks pushed a commit that referenced this pull request Jun 12, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants