Skip to content

Commit e93732d

Browse files
committed
Updating FlashComponent::__call() docblock
- [x] element usage example - [x] fixing docblock paths
1 parent 58e69c5 commit e93732d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Controller/Component/FlashComponent.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,15 @@ public function set($message, array $options = [])
103103
* Magic method for verbose flash methods based on element names.
104104
*
105105
* For example: $this->Flash->success('My message') would use the
106-
* success.ctp element under `App/Template/Element/Flash` for rendering the
106+
* success.ctp element under `src/Template/Element/Flash` for rendering the
107107
* flash message.
108+
*
109+
* Note that the parameter `element` will be always overridden. In order to call a
110+
* specific element from a plugin, you should set the `plugin` option in $args.
111+
*
112+
* For example: $this->Flash->warning('My message', ['plugin' => 'PluginName']) would
113+
* use the warning.ctp element under `plugins/src/Template/Element/Flash` for rendering
114+
* the flash message.
108115
*
109116
* @param string $name Element name to use.
110117
* @param array $args Parameters to pass when calling `FlashComponent::set()`.

0 commit comments

Comments
 (0)