Open jasonrgd opened 9 years ago
Something like this?
require('vendor/bem/bh/index.php');
$bh = new BEM/BH();
$bh->match('type1', function ($ctx, $json) {
$ctx->tag('button');
});
$bh->match('type2', function ($ctx, $json) {
$ctx->attrs(['id' => 12]);
});
echo $bh->apply([
['block' => 'type1'],
['block' => 'type2'],
]);
// will render: <button class="type1"></button><div class="type2" id="12"></div>
it would be nice to have some form of demo code which can be directly executed on download.