M
M
Mikhail Zakharov2016-03-31 15:14:07
Yii
Mikhail Zakharov, 2016-03-31 15:14:07

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

2 answer(s)
G
Grigory Esin, 2016-03-31
@werwolf87

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

V
Valery, 2016-03-31
@supervaleha

Yii - it's a framework) Doesn't accept the server - install
it as it was already said and everything will fall into place :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question