gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
<div class="col text-center small">© <?= date('Y'); ?> <?= \Yii:t('app', 'All…
- User
ParseError: syntax error, unexpected token ":", expecting "," or ";"
- Assistant
The error:
ParseError: syntax error, unexpected token ":", expecting "," or ";"is caused by this part of your code:
<?= \Yii:t('app', 'All rights reserved.'); ?>Explanation
The
\Yii:t()syntax is incorrect. The colon:afterYiiis being interpreted as a token by the PHP parser, but what you actually want is to call thet()method of theYiiclass or object.In PHP, the scope resolution operator is
::(double colon), not a single colon:.Correct syntax
<?= \Yii::t('app', 'All rights reserved.'); ?>Full corrected code:
<div class="col text-center small">© <?= date('Y'); ?> <?= \Yii::t('app', 'All rights reserved.'); ?></div>
Summary
- Use
::for static method calls in PHP (Yii::t()) - Single
:is a syntax error where it’s unexpected
Fixing the colon to double colon should resolve your
ParseError. - Use