A
A
amstr1k2014-10-10 14:34:35
Yii
amstr1k, 2014-10-10 14:34:35

Is it possible to insert into a Fenom template?

There is a php template engine Fenom , framework Yii1 and an extension for the fenom + yii bundle. How to make it possible to insert php inserts directly into the template?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shalganov, 2014-10-10
@Aco

There is no such possibility, but you can easily add:

$fenom->addBlockCompiler('php', 'Fenom\Compiler::nope', function ($tokens, Tag $tag) {
    return '<?php ' . $tag->cutContent();
});

Since Fenom expects the compiler to return PHP code without the <?php ?> tags, a hack has to be used.
Usage:
{php} echo "This is PHP!"; {/php}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question