Answer the question
In order to leave comments, you need to log in
What could be the reason why yii2 does not accept short tags?
I tried to display code in views using <?, Yii2 treats it as text. Only <?php. While other code works: <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
Answer the question
In order to leave comments, you need to log in
Most likely you have the short_open_tag option disabled: php.net/manual/ru/ini.core.php#ini.short-open-tag
Turn it on and you will be happy.
The "<?=" tag works regardless of whether "short_open_tag" is on or off
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question