Created
December 10, 2015 07:54
-
-
Save FMCorz/9e1243d965ceb2c94088 to your computer and use it in GitHub Desktop.
Testing Mustache pix helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{! | |
@template core/pix_test | |
Example context (json): | |
{ | |
"icon": "t/edit", | |
"component": "core" | |
} | |
}} | |
<ul> | |
<li>{{#pix}}t/edit{{/pix}}</li> | |
<li>{{#pix}}t/edit, core{{/pix}}</li> | |
<li>{{#pix}}t/edit, core, SomeAlt{{/pix}}</li> | |
<li>{{#pix}}t/edit, core, {{#str}}invaliddata, error{{/str}}{{/pix}}</li> | |
<li>{{#pix}}{{icon}}{{/pix}}</li> | |
<li>{{#pix}}{{icon}}, {{component}}{{/pix}}</li> | |
<li>{{#pix}}{{icon}}, {{component}}, SomeAlt{{/pix}}</li> | |
<li>{{#pix}}{{icon}}, {{component}}, {{#str}}invaliddata, error{{/str}}{{/pix}}</li> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('config.php'); | |
$PAGE->set_context(context_system::instance()); | |
$data = array( | |
'message' => 'test', | |
'icon' => 't/edit', | |
'component' => 'moodle' | |
); | |
echo $OUTPUT->render_from_template('core/pix_test', $data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment