Module templates
Because you may want to standardize some of your components, you can set templates in config file.
Under templates
key, create a new one with your attributes, then call it with the key from
:
attrs['from'] => 'template key'
Paths to config files
Classes | Config |
---|---|
Html::{module} |
bootstrap/html_{module} .php |
Form::{module} |
bootstrap/form_{module} .php |
Simple Example with a button:
// in config 'bootstrap/html_button.php': 'templates' => array( 'example' => array( 'status' => 'primary', 'icon' => 'thumbs-up', 'size' => 'large', 'title' => 'Some Title', 'class' => 'button-submit' ) Html::button('', 'Submit', array('from' => 'example'))Submit