Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

hashmode
Copy link
Contributor

The changes are discussed in this issue #9240

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
Copy link
Contributor

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"
@codecov-io
Copy link

codecov-io commented Aug 10, 2016

Current coverage is 94.93% (diff: 100%)

Merging #9246 into 3.next will decrease coverage by 0.01%

@@             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          

Powered by Codecov. Last update 971da66...cb1f68c

@ADmad ADmad added this to the 3.3.0 milestone Aug 10, 2016
@ADmad
Copy link
Member

ADmad commented Aug 10, 2016

Tests required for the new feature

@markstory markstory modified the milestones: 3.3.0, 3.3.1 Aug 13, 2016
@markstory markstory modified the milestones: 3.3.2, 3.3.3 Aug 22, 2016
@markstory markstory modified the milestones: 3.3.3, 3.3.4 Sep 3, 2016
@markstory
Copy link
Member

@hashmode Do you need a hand with writing tests?

@hashmode
Copy link
Contributor Author

@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

@markstory markstory self-assigned this Sep 12, 2016
@markstory markstory modified the milestones: 3.4.0, 3.3.4 Sep 16, 2016
markstory added a commit that referenced this pull request Sep 16, 2016
Remove a redundant element, and add an element for testing
`plugin=>false` mode.
markstory added a commit that referenced this pull request Sep 16, 2016
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.
markstory added a commit that referenced this pull request Sep 16, 2016
Remove a redundant element, and add an element for testing
`plugin=>false` mode.
markstory added a commit that referenced this pull request Sep 16, 2016
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
markstory added a commit that referenced this pull request Sep 16, 2016
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
@markstory
Copy link
Member

Merged into master in 17a9199

@markstory markstory closed this Sep 16, 2016
@inoas
Copy link
Contributor

inoas commented Sep 16, 2016

@hashmode could you update the cakephp/docs for this?

@markstory
Copy link
Member

I think this could be an API docs only thing. We can't reasonably fit every use case and scenario into the book 😄

@inoas
Copy link
Contributor

inoas commented Sep 16, 2016

Took a look at the tests and it wasn't directly obvious how to use it from a view template.
From the issue #9240 - Is this the syntax? <?php echo $this->element('my_element', [], ['plugin' => false]);?> I can add that one line to the docs then.

@markstory
Copy link
Member

@inoas The example you have is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants