Replaced "<?php echo" with "<?=" that is always available for PHP 5.4

This commit is contained in:
Alexander Makarov 2013-10-18 14:04:15 +04:00
parent 65c64d4c70
commit 4bf4751320
5 changed files with 22 additions and 22 deletions

View File

@ -14,8 +14,8 @@ app\config\AppAsset::register($this);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="<?php echo Yii::$app->charset; ?>"/>
<title><?php echo Html::encode($this->title); ?></title>
<meta charset="<?=Yii::$app->charset; ?>"/>
<title><?=Html::encode($this->title); ?></title>
<?php $this->head(); ?>
</head>
<body>
@ -45,16 +45,16 @@ app\config\AppAsset::register($this);
?>
<div class="container">
<?php echo Breadcrumbs::widget([
<?=Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]); ?>
<?php echo $content; ?>
<?=$content; ?>
</div>
<footer class="footer">
<div class="container">
<p class="pull-left">&copy; My Company <?php echo date('Y'); ?></p>
<p class="pull-right"><?php echo Yii::powered(); ?></p>
<p class="pull-left">&copy; My Company <?=date('Y'); ?></p>
<p class="pull-right"><?=Yii::powered(); ?></p>
</div>
</footer>

View File

@ -8,11 +8,11 @@ $this->title = 'About';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-about">
<h1><?php echo Html::encode($this->title); ?></h1>
<h1><?=Html::encode($this->title); ?></h1>
<p>
This is the About page. You may modify the following file to customize its content:
</p>
<code><?php echo __FILE__; ?></code>
<code><?=__FILE__; ?></code>
</div>

View File

@ -12,7 +12,7 @@ $this->title = 'Contact';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-contact">
<h1><?php echo Html::encode($this->title); ?></h1>
<h1><?=Html::encode($this->title); ?></h1>
<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
@ -29,16 +29,16 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="row">
<div class="col-lg-5">
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
<?php echo $form->field($model, 'name'); ?>
<?php echo $form->field($model, 'email'); ?>
<?php echo $form->field($model, 'subject'); ?>
<?php echo $form->field($model, 'body')->textArea(['rows' => 6]); ?>
<?php echo $form->field($model, 'verifyCode')->widget(Captcha::className(), [
<?=$form->field($model, 'name'); ?>
<?=$form->field($model, 'email'); ?>
<?=$form->field($model, 'subject'); ?>
<?=$form->field($model, 'body')->textArea(['rows' => 6]); ?>
<?=$form->field($model, 'verifyCode')->widget(Captcha::className(), [
'options' => ['class' => 'form-control'],
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
]); ?>
<div class="form-group">
<?php echo Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
<?=Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -13,10 +13,10 @@ $this->title = $name;
?>
<div class="site-error">
<h1><?php echo Html::encode($this->title); ?></h1>
<h1><?=Html::encode($this->title); ?></h1>
<div class="alert alert-danger">
<?php echo nl2br(Html::encode($message)); ?>
<?=nl2br(Html::encode($message)); ?>
</div>
<p>

View File

@ -11,7 +11,7 @@ $this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-login">
<h1><?php echo Html::encode($this->title); ?></h1>
<h1><?=Html::encode($this->title); ?></h1>
<p>Please fill out the following fields to login:</p>
@ -24,17 +24,17 @@ $this->params['breadcrumbs'][] = $this->title;
],
]); ?>
<?php echo $form->field($model, 'username'); ?>
<?=$form->field($model, 'username'); ?>
<?php echo $form->field($model, 'password')->passwordInput(); ?>
<?=$form->field($model, 'password')->passwordInput(); ?>
<?php echo $form->field($model, 'rememberMe', [
<?=$form->field($model, 'rememberMe', [
'template' => "<div class=\"col-lg-offset-1 col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
])->checkbox(); ?>
<div class="form-group">
<div class="col-lg-offset-1 col-lg-11">
<?php echo Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
<?=Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
</div>
</div>