PHP 클래스 Bootstrap\View\Helper\BootstrapFlashHelper

상속: extends Cake\View\Helper\FlashHelper, use trait BootstrapTrait
파일 보기 프로젝트 열기: holt59/cakephp3-bootstrap3-helpers

보호된 프로퍼티들

프로퍼티 타입 설명
$_bootstrapTemplates

공개 메소드들

메소드 설명
render ( string $key = 'flash', array $options = [] ) : string | void Used to render the message set in FlashComponent::set()

메소드 상세

render() 공개 메소드

In your view: $this->Flash->render('somekey'); Will default to flash if no param is passed You can pass additional information into the flash message generation. This allows you to consolidate all the parameters for a given type of flash message into the view. echo $this->Flash->render('flash', ['params' => ['name' => $user['User']['name']]]); This would pass the current user's name into the flash message, so you could create personalized messages without the controller needing access to that data. Lastly you can choose the element that is used for rendering the flash message. Using custom elements allows you to fully customize how flash messages are generated. echo $this->Flash->render('flash', ['element' => 'my_custom_element']); If you want to use an element from a plugin for rendering your flash message you can use the dot notation for the plugin's element name: echo $this->Flash->render('flash', [ 'element' => 'MyPlugin.my_custom_element', ]);
public render ( string $key = 'flash', array $options = [] ) : string | void
$key string The [Flash.]key you are rendering in the view.
$options array Additional options to use for the creation of this flash message. Supports the 'params', and 'element' keys that are used in the helper.
리턴 string | void Rendered flash message or null if flash key does not exist in session.

프로퍼티 상세

$_bootstrapTemplates 보호되어 있는 프로퍼티

protected $_bootstrapTemplates