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

Feature/#6441 prefix path resolver #6963

Merged

Conversation

Ocramius
Copy link
Member

@Ocramius Ocramius commented Dec 5, 2014

Ping @ojhaujjwal

This is a rewrite of #6441

@Ocramius Ocramius added this to the 2.4.0 milestone Dec 5, 2014
@Ocramius Ocramius self-assigned this Dec 5, 2014
* @param ServiceLocatorInterface $serviceLocator
* @return PrefixPathStackResolver
*/
public function createService(ServiceLocatorInterface $serviceLocator)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suppose, I have something like this:

// in module/module.config.php
return [
    'view_manager' => [
        'default_template_suffix' => 'php',
    ]
];

So, I have defined default template prefix as 'php' but this only works for TemplatePathStack resolver and does not work for PrefixPathStackResolver. IMO this is inconsistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

default_template_suffix is not supported anymore: if you need to customize the suffixes, you can pass in a custom resolver instance for a particular prefix. I think it's a decent tradeoff and it reduced coupling between this resolver and the TemplatePathStack

…on flags, as safe defaults are sufficient for a default implementation
…` constructor arg: relevant only for custom implementations
… API (`set`, `add`, `setTemplatePathStackResolver`, `getTemplatePathStackResolver`)
…ck` instances in the `PrefixPathStackResolver`
…assed to the `PrefixPathStackResolver` directly with the prefixes
…solverInterface` instances assigned to some prefixes
@Ocramius Ocramius force-pushed the feature/#6441-prefix-path-resolver branch from ab066fa to d25bc94 Compare December 8, 2014 22:10
@Ocramius
Copy link
Member Author

@ojhaujjwal any more remarks? Do you agree or disagree with the changes introduced here? I realize it looks quite different from what you had in mind in the first shot...

@ojhaujjwal
Copy link
Contributor

I am ok with both the implementations. I would love to hear comments from others on these 2 PRs.

Ocramius added a commit that referenced this pull request Dec 16, 2014
@Ocramius Ocramius merged commit 45151ee into zendframework:develop Dec 16, 2014
@Ocramius Ocramius deleted the feature/#6441-prefix-path-resolver branch December 16, 2014 06:08
gianarb pushed a commit to zendframework/zend-view that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants