Id like to pass buttons from the cakePHP 2 (note: I’m using Twitter Bootstrap 2.2.1) into an Element in app/View/Elements/Toolbar.ctp
<div class="actions">
<?php echo $this->Html->link(__('New User'), array('action' => 'add'), array('class' => 'btn btn-small',)); ?>
</div>
Above is an example of the button.
Depending on the view, I’d like to pass in different Buttons with different actions.
How do I do that? With Elements, Blocks, requestaction() or what?
The cakephp way doing would look like this
In view
in element there will be variable called
$buttonavailable. Note that$button_typevariable is also available in element.That should do it