We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CrudView.php is used to render the views, and it's loading BootstrapUI.Flash with default settings.
BootstrapUI.Flash
My app has a custom render element for Flash messages, but it's not being used because of the defaults.
I also noticed BootstrapUI.Flash is loaded twice by the view.
protected function _setupHelpers() { $this->loadHelper('Html', ['className' => 'BootstrapUI.Html']); $this->loadHelper('Form', [ 'className' => 'BootstrapUI.Form', 'widgets' => [ 'datetime' => ['CrudView\View\Widget\DateTimeWidget', 'select'] ] ]); $this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']); $this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']); $this->loadHelper('CrudView.CrudView'); $this->loadHelper('BootstrapUI.Flash'); if (Configure::read('CrudView.useAssetCompress')) { $this->loadHelper('AssetCompress.AssetCompress'); } }
Any ideas how I can make CrudView use my Template\Element\Flash elements?
Template\Element\Flash
The text was updated successfully, but these errors were encountered:
So I think I solved my issue. If my approach is the correct way, then please close this issue.
I created my own view called AdminView.php and derived it from CrudView.
AdminView.php
CrudView
I then override the _setupHelpers() method, and just skipped BootstrapUI.Flash as I don't need it.
_setupHelpers()
A quick test appears to have fixed my flash messages.
Here's my view if anyone wants a copy.
<?php namespace App\View; use CrudView\View\CrudView; /** * @property \BootstrapUI\View\Helper\FormHelper $Form * @property \BootstrapUI\View\Helper\HtmlHelper $Html * @property \BootstrapUI\View\Helper\PaginatorHelper $Paginator * @property \CrudView\View\Helper\CrudViewHelper $CrudView */ class AdminView extends CrudView { /** * @var string */ public $layout = 'default'; /** * Setup helpers */ protected function _setupHelpers() { $this->loadHelper('Html', ['className' => 'BootstrapUI.Html']); $this->loadHelper('Form', [ 'className' => 'BootstrapUI.Form', 'widgets' => [ 'datetime' => ['CrudView\View\Widget\DateTimeWidget', 'select'] ] ]); $this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']); $this->loadHelper('CrudView.CrudView'); } }
Sorry, something went wrong.
This works fine for.
No branches or pull requests
CrudView.php is used to render the views, and it's loading
BootstrapUI.Flash
with default settings.My app has a custom render element for Flash messages, but it's not being used because of the defaults.
I also noticed BootstrapUI.Flash is loaded twice by the view.
Any ideas how I can make CrudView use my
Template\Element\Flash
elements?The text was updated successfully, but these errors were encountered: