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
Option to use application's element with same name from plugin #9246
Conversation
added comments for methods: element, getElementFileName for functionality to allow using elements of the application from inside plugin
@@ -1188,11 +1191,12 @@ protected function _getLayoutFileName($name = null) | |||
* Finds an element filename, returns false on failure. | |||
* | |||
* @param string $name The name of the element to find. | |||
* @param boolean $pluginCheck - if false will ignore the request's plugin if parsed plugin is not loaded |
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.
Expected "bool" but found "boolean" for parameter type
fix comment issue by "stickler-ci"
Current coverage is 94.93% (diff: 100%)@@ 3.next #9246 diff @@
==========================================
Files 409 409
Lines 27995 27996 +1
Methods 3355 3355
Messages 0 0
Branches 0 0
==========================================
- Hits 26581 26579 -2
- Misses 1414 1417 +3
Partials 0 0
|
Tests required for the new feature |
@hashmode Do you need a hand with writing tests? |
@markstory actually it would be great (cant seem to manage my time), I ticked the "allow edits from maintainers" checkbox, thanks and sry for the delay |
Remove a redundant element, and add an element for testing `plugin=>false` mode.
Refs #9246. Because of the conflict I've taken the opportunity to do some cleanup resulting in shorter cache file names. Because 'cache', 'callbacks' and now 'plugin' were effectively invariant there is really no point in them being in the cache key.
Remove a redundant element, and add an element for testing `plugin=>false` mode.
Remove branching by adding a default. I've also removed the invariant 'cache', and 'callbacks' components of element cache keys. These segments never changed and would have been joined by 'plugin' which felt like a waste. Refs #9246
Allow plugin => false to be used in View::element() to disable rendering of plugin elements that share the same name as an app element. Refs #9246
Merged into master in 17a9199 |
@hashmode could you update the cakephp/docs for this? |
I think this could be an API docs only thing. We can't reasonably fit every use case and scenario into the book 😄 |
Took a look at the tests and it wasn't directly obvious how to use it from a view template. |
@inoas The example you have is correct. |
The changes are discussed in this issue #9240