-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added presenter mapper #16
base: master
Are you sure you want to change the base?
Conversation
I am not sure that own mapper is really needed. I agree that mapping can be enhanced for |
I for one would use such mapper. It really enables modularity across packages and default implementation can be reused as a fallback for custom implementation. Now I can have multiple packages sharing same <?php $mapping = [ 'shop' => [
'packageA/src/Shop/Presenters',
'packageB/src/Shop/Presenters',
// ...
] ] For now I have to prefix each package, because using multiple directories for same |
👍 |
I think that use |
@matej21 you are rigth. I removed |
* @return string | ||
*/ | ||
function unformatPresenterClass($class); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline
👍 for this |
/** @var array */ | ||
private $cache = array(); | ||
|
||
/** @var Nette\DI\Container */ | ||
private $container; | ||
|
||
/** @var \Nette\Application\IPresenterMapper */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for FQCN.
👍 I like it. |
* @param string | ||
* @return string | ||
*/ | ||
public function formatPresenterClass($presenter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this method for BC purposes and just alias it to $this->presenterMapper->formatPresenterClass(...)
.
What is purpose of this PR? To add What is the advantage of "split" 2-methods IPresenterFactory into 2-methods IPresenterFactory plus 2-methods IPresenterMapper? Is there really such big need to create your own mappers? |
c6ea262
to
7fc9a04
Compare
d4f8f8f
to
b9ada7c
Compare
ab57645
to
3386bd1
Compare
b7c910a
to
3f30cee
Compare
b9d4eb3
to
8ca92c7
Compare
e3a1ef7
to
b998e4d
Compare
88ef0bd
to
b7df270
Compare
Discusion: http://forum.nette.org/en/19620-better-mapping-configuration#p135799
For easier use custom mapping implementation
with nette/bootstrap#8