Skip to content
PHP Ecosystem
Explore

Usage examples

Each section shows one use case with one php block, written as code that runs in a view and echoes its output. The documentation site can render each block as a live demo, so the rendered output is not copied into this page.

Describe what the example shows.

use yii\template\Example;
$example = new Example();
echo $example->getExample(true) ? 'Legacy mode' : 'Default mode';

Back to documentation