mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 06:17:56 +08:00
Replaced "<?php echo" with "<?=" that is always available for PHP 5.4
This commit is contained in:
@@ -15,8 +15,8 @@ AppAsset::register($this);
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php echo Yii::$app->charset; ?>"/>
|
<meta charset="<?=Yii::$app->charset; ?>"/>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -45,16 +45,16 @@ AppAsset::register($this);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php echo Breadcrumbs::widget([
|
<?=Breadcrumbs::widget([
|
||||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="pull-left">© My Company <?php echo date('Y'); ?></p>
|
<p class="pull-left">© My Company <?=date('Y'); ?></p>
|
||||||
<p class="pull-right"><?php echo Yii::powered(); ?></p>
|
<p class="pull-right"><?=Yii::powered(); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ $this->title = $name;
|
|||||||
?>
|
?>
|
||||||
<div class="site-error">
|
<div class="site-error">
|
||||||
|
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<?php echo nl2br(Html::encode($message)); ?>
|
<?=nl2br(Html::encode($message)); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -11,18 +11,18 @@ $this->title = 'Login';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-login">
|
<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>
|
<p>Please fill out the following fields to login:</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
||||||
<?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')->checkbox(); ?>
|
<?=$form->field($model, 'rememberMe')->checkbox(); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use yii\helpers\Html;
|
|||||||
$resetLink = Yii::$app->urlManager->createAbsoluteUrl('site/reset-password', ['token' => $user->password_reset_token]);
|
$resetLink = Yii::$app->urlManager->createAbsoluteUrl('site/reset-password', ['token' => $user->password_reset_token]);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
Hello <?php echo Html::encode($user->username)?>,
|
Hello <?=Html::encode($user->username)?>,
|
||||||
|
|
||||||
Follow the link below to reset your password:
|
Follow the link below to reset your password:
|
||||||
|
|
||||||
<?php echo Html::a(Html::encode($resetLink), $resetLink)?>
|
<?=Html::a(Html::encode($resetLink), $resetLink)?>
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ AppAsset::register($this);
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php echo Yii::$app->charset; ?>"/>
|
<meta charset="<?=Yii::$app->charset; ?>"/>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -49,17 +49,17 @@ AppAsset::register($this);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php echo Breadcrumbs::widget([
|
<?=Breadcrumbs::widget([
|
||||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo Alert::widget()?>
|
<?=Alert::widget()?>
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="pull-left">© My Company <?php echo date('Y'); ?></p>
|
<p class="pull-left">© My Company <?=date('Y'); ?></p>
|
||||||
<p class="pull-right"><?php echo Yii::powered(); ?></p>
|
<p class="pull-right"><?=Yii::powered(); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ $this->title = 'About';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-about">
|
<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>
|
<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>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ $this->title = 'Contact';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-contact">
|
<div class="site-contact">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
|
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
|
||||||
@@ -21,16 +21,16 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
|
||||||
<?php echo $form->field($model, 'name'); ?>
|
<?=$form->field($model, 'name'); ?>
|
||||||
<?php echo $form->field($model, 'email'); ?>
|
<?=$form->field($model, 'email'); ?>
|
||||||
<?php echo $form->field($model, 'subject'); ?>
|
<?=$form->field($model, 'subject'); ?>
|
||||||
<?php echo $form->field($model, 'body')->textArea(['rows' => 6]); ?>
|
<?=$form->field($model, 'body')->textArea(['rows' => 6]); ?>
|
||||||
<?php echo $form->field($model, 'verifyCode')->widget(Captcha::className(), [
|
<?=$form->field($model, 'verifyCode')->widget(Captcha::className(), [
|
||||||
'options' => ['class' => 'form-control'],
|
'options' => ['class' => 'form-control'],
|
||||||
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
|
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
|
||||||
]); ?>
|
]); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ $this->title = $name;
|
|||||||
?>
|
?>
|
||||||
<div class="site-error">
|
<div class="site-error">
|
||||||
|
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<?php echo nl2br(Html::encode($message)); ?>
|
<?=nl2br(Html::encode($message)); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -11,21 +11,21 @@ $this->title = 'Login';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-login">
|
<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>
|
<p>Please fill out the following fields to login:</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
||||||
<?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')->checkbox(); ?>
|
<?=$form->field($model, 'rememberMe')->checkbox(); ?>
|
||||||
<div style="color:#999;margin:1em 0">
|
<div style="color:#999;margin:1em 0">
|
||||||
If you forgot your password you can <?php echo Html::a('reset it', ['site/request-password-reset'])?>.
|
If you forgot your password you can <?=Html::a('reset it', ['site/request-password-reset'])?>.
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Login', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,16 +11,16 @@ $this->title = 'Request password reset';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-request-password-reset">
|
<div class="site-request-password-reset">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>Please fill out your email. A link to reset password will be sent there.</p>
|
<p>Please fill out your email. A link to reset password will be sent there.</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
|
||||||
<?php echo $form->field($model, 'email'); ?>
|
<?=$form->field($model, 'email'); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Send', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Send', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,16 +11,16 @@ $this->title = 'Reset password';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-reset-password">
|
<div class="site-reset-password">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>Please choose your new password:</p>
|
<p>Please choose your new password:</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'reset-password-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'reset-password-form']); ?>
|
||||||
<?php echo $form->field($model, 'password')->passwordInput(); ?>
|
<?=$form->field($model, 'password')->passwordInput(); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Save', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Save', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,18 +11,18 @@ $this->title = 'Signup';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-signup">
|
<div class="site-signup">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>Please fill out the following fields to signup:</p>
|
<p>Please fill out the following fields to signup:</p>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>
|
||||||
<?php echo $form->field($model, 'username'); ?>
|
<?=$form->field($model, 'username'); ?>
|
||||||
<?php echo $form->field($model, 'email'); ?>
|
<?=$form->field($model, 'email'); ?>
|
||||||
<?php echo $form->field($model, 'password')->passwordInput(); ?>
|
<?=$form->field($model, 'password')->passwordInput(); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Signup', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Signup', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ app\config\AppAsset::register($this);
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php echo Yii::$app->charset; ?>"/>
|
<meta charset="<?=Yii::$app->charset; ?>"/>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -45,16 +45,16 @@ app\config\AppAsset::register($this);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php echo Breadcrumbs::widget([
|
<?=Breadcrumbs::widget([
|
||||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="pull-left">© My Company <?php echo date('Y'); ?></p>
|
<p class="pull-left">© My Company <?=date('Y'); ?></p>
|
||||||
<p class="pull-right"><?php echo Yii::powered(); ?></p>
|
<p class="pull-right"><?=Yii::powered(); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ $this->title = 'About';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-about">
|
<div class="site-about">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This is the About page. You may modify the following file to customize its content:
|
This is the About page. You may modify the following file to customize its content:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<code><?php echo __FILE__; ?></code>
|
<code><?=__FILE__; ?></code>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ $this->title = 'Contact';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-contact">
|
<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')): ?>
|
<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
|
||||||
|
|
||||||
@@ -29,16 +29,16 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
|
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
|
||||||
<?php echo $form->field($model, 'name'); ?>
|
<?=$form->field($model, 'name'); ?>
|
||||||
<?php echo $form->field($model, 'email'); ?>
|
<?=$form->field($model, 'email'); ?>
|
||||||
<?php echo $form->field($model, 'subject'); ?>
|
<?=$form->field($model, 'subject'); ?>
|
||||||
<?php echo $form->field($model, 'body')->textArea(['rows' => 6]); ?>
|
<?=$form->field($model, 'body')->textArea(['rows' => 6]); ?>
|
||||||
<?php echo $form->field($model, 'verifyCode')->widget(Captcha::className(), [
|
<?=$form->field($model, 'verifyCode')->widget(Captcha::className(), [
|
||||||
'options' => ['class' => 'form-control'],
|
'options' => ['class' => 'form-control'],
|
||||||
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
|
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
|
||||||
]); ?>
|
]); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
|
<?=Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ $this->title = $name;
|
|||||||
?>
|
?>
|
||||||
<div class="site-error">
|
<div class="site-error">
|
||||||
|
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<?php echo nl2br(Html::encode($message)); ?>
|
<?=nl2br(Html::encode($message)); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $this->title = 'Login';
|
|||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="site-login">
|
<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>
|
<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>",
|
'template' => "<div class=\"col-lg-offset-1 col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
|
||||||
])->checkbox(); ?>
|
])->checkbox(); ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-lg-offset-1 col-lg-11">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -340,10 +340,10 @@ It is represented as an `ActiveField` object. Using fields, you can build a form
|
|||||||
|
|
||||||
```php
|
```php
|
||||||
<?php $form = yii\widgets\ActiveForm::begin(); ?>
|
<?php $form = yii\widgets\ActiveForm::begin(); ?>
|
||||||
<?php echo $form->field($model, 'username'); ?>
|
<?=$form->field($model, 'username'); ?>
|
||||||
<?php echo $form->field($model, 'password')->passwordInput(); ?>
|
<?=$form->field($model, 'password')->passwordInput(); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Login'); ?>
|
<?=Html::submitButton('Login'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php yii\widgets\ActiveForm::end(); ?>
|
<?php yii\widgets\ActiveForm::end(); ?>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ as the corresponding key.
|
|||||||
So the view for the action above should be in `views/site/index.php` and can be something like:
|
So the view for the action above should be in `views/site/index.php` and can be something like:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<p>Hello, <?php echo $username?>!</p>
|
<p>Hello, <?=$username?>!</p>
|
||||||
```
|
```
|
||||||
|
|
||||||
Instead of just scalar values you can pass anything else such as arrays or objects.
|
Instead of just scalar values you can pass anything else such as arrays or objects.
|
||||||
@@ -78,7 +78,7 @@ use yii\helpers\Html;
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="username">
|
<div class="username">
|
||||||
<?php echo Html::encode($user->name); ?>
|
<?=Html::encode($user->name); ?>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ use yii\helpers\HtmlPurifier;
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<?php echo HtmlPurifier::process($post->text); ?>
|
<?=HtmlPurifier::process($post->text); ?>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -258,16 +258,16 @@ use yii\helpers\Html;
|
|||||||
?>
|
?>
|
||||||
<?php $this->beginPage(); ?>
|
<?php $this->beginPage(); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo Yii::$app->charset; ?>">
|
<html lang="<?=Yii::$app->charset; ?>">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php echo Yii::$app->charset; ?>"/>
|
<meta charset="<?=Yii::$app->charset; ?>"/>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php $this->beginBody(); ?>
|
<?php $this->beginBody(); ?>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
<footer class="footer">© 2013 me :)</footer>
|
<footer class="footer">© 2013 me :)</footer>
|
||||||
<?php $this->endBody(); ?>
|
<?php $this->endBody(); ?>
|
||||||
@@ -297,8 +297,8 @@ use yii\helpers\Html;
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="profile">
|
<div class="profile">
|
||||||
<h2><?php echo Html::encode($username); ?></h2>
|
<h2><?=Html::encode($username); ?></h2>
|
||||||
<p><?php echo Html::encode($tagline); ?></p>
|
<p><?=Html::encode($tagline); ?></p>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ $this->title = 'Yii Debugger';
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($manifest as $tag => $data): ?>
|
<?php foreach ($manifest as $tag => $data): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo Html::a($tag, array('view', 'tag' => $tag)); ?></td>
|
<td><?=Html::a($tag, array('view', 'tag' => $tag)); ?></td>
|
||||||
<td><?php echo date('Y-m-d h:i:sa', $data['time']); ?></td>
|
<td><?=date('Y-m-d h:i:sa', $data['time']); ?></td>
|
||||||
<td><?php echo $data['ip']; ?></td>
|
<td><?=$data['ip']; ?></td>
|
||||||
<td><?php echo $data['method']; ?></td>
|
<td><?=$data['method']; ?></td>
|
||||||
<td><?php echo $data['url']; ?></td>
|
<td><?=$data['url']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ $url = $panels['request']->getUrl();
|
|||||||
?>
|
?>
|
||||||
<div id="yii-debug-toolbar">
|
<div id="yii-debug-toolbar">
|
||||||
<?php foreach ($panels as $panel): ?>
|
<?php foreach ($panels as $panel): ?>
|
||||||
<?php echo $panel->getSummary(); ?>
|
<?=$panel->getSummary(); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<span class="yii-debug-toolbar-toggler" onclick="<?php echo $minJs; ?>">›</span>
|
<span class="yii-debug-toolbar-toggler" onclick="<?=$minJs; ?>">›</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="yii-debug-toolbar-min">
|
<div id="yii-debug-toolbar-min">
|
||||||
<a href="<?php echo $url; ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
|
<a href="<?=$url; ?>" title="Open Yii Debugger" id="yii-debug-toolbar-logo">
|
||||||
<img width="29" height="30" alt="" src="<?php echo ConfigPanel::getYiiLogo(); ?>">
|
<img width="29" height="30" alt="" src="<?=ConfigPanel::getYiiLogo(); ?>">
|
||||||
</a>
|
</a>
|
||||||
<span class="yii-debug-toolbar-toggler" onclick="<?php echo $maxJs; ?>">‹</span>
|
<span class="yii-debug-toolbar-toggler" onclick="<?=$maxJs; ?>">‹</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ $this->title = 'Yii Debugger';
|
|||||||
Yii Debugger
|
Yii Debugger
|
||||||
</div>
|
</div>
|
||||||
<?php foreach ($panels as $panel): ?>
|
<?php foreach ($panels as $panel): ?>
|
||||||
<?php echo $panel->getSummary(); ?>
|
<?=$panel->getSummary(); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ $this->title = 'Yii Debugger';
|
|||||||
echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
|
echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $activePanel->getDetail(); ?>
|
<?=$activePanel->getDetail(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ yii\debug\DebugAsset::register($this);
|
|||||||
<html>
|
<html>
|
||||||
<?php $this->beginPage(); ?>
|
<?php $this->beginPage(); ?>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php $this->beginBody(); ?>
|
<?php $this->beginBody(); ?>
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
<?php $this->endBody(); ?>
|
<?php $this->endBody(); ?>
|
||||||
</body>
|
</body>
|
||||||
<?php $this->endPage(); ?>
|
<?php $this->endPage(); ?>
|
||||||
|
|||||||
@@ -13,15 +13,15 @@ echo "<?php\n";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (!empty($generator->ns)): ?>
|
<?php if (!empty($generator->ns)): ?>
|
||||||
namespace <?php echo $generator->ns; ?>;
|
namespace <?=$generator->ns; ?>;
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
class <?php echo $generator->getControllerClass(); ?> extends <?php echo '\\' . trim($generator->baseClass, '\\') . "\n"; ?>
|
class <?=$generator->getControllerClass(); ?> extends <?='\\' . trim($generator->baseClass, '\\') . "\n"; ?>
|
||||||
{
|
{
|
||||||
<?php foreach($generator->getActionIDs() as $action): ?>
|
<?php foreach($generator->getActionIDs() as $action): ?>
|
||||||
public function action<?php echo Inflector::id2camel($action); ?>()
|
public function action<?=Inflector::id2camel($action); ?>()
|
||||||
{
|
{
|
||||||
return $this->render('<?php echo $action; ?>');
|
return $this->render('<?=$action; ?>');
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ echo "<?php\n";
|
|||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
*/
|
*/
|
||||||
<?php echo "?>"; ?>
|
<?="?>"; ?>
|
||||||
|
|
||||||
<h1><?php echo $generator->getControllerID() . '/' . $action; ?></h1>
|
<h1><?=$generator->getControllerID() . '/' . $action; ?></h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
You may change the content of this page by modifying
|
You may change the content of this page by modifying
|
||||||
the file <code><?php echo '<?php'; ?> echo __FILE__; ?></code>.
|
the file <code><?='<?php'; ?> echo __FILE__; ?></code>.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -21,19 +21,19 @@ $actionParamComments = $generator->generateActionParamComments();
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
namespace <?php echo StringHelper::dirname(ltrim($generator->controllerClass, '\\')); ?>;
|
namespace <?=StringHelper::dirname(ltrim($generator->controllerClass, '\\')); ?>;
|
||||||
|
|
||||||
use <?php echo ltrim($generator->modelClass, '\\'); ?>;
|
use <?=ltrim($generator->modelClass, '\\'); ?>;
|
||||||
use <?php echo ltrim($generator->searchModelClass, '\\'); ?>;
|
use <?=ltrim($generator->searchModelClass, '\\'); ?>;
|
||||||
use yii\data\ActiveDataProvider;
|
use yii\data\ActiveDataProvider;
|
||||||
use <?php echo ltrim($generator->baseControllerClass, '\\'); ?>;
|
use <?=ltrim($generator->baseControllerClass, '\\'); ?>;
|
||||||
use yii\web\HttpException;
|
use yii\web\HttpException;
|
||||||
use yii\web\VerbFilter;
|
use yii\web\VerbFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <?php echo $controllerClass; ?> implements the CRUD actions for <?php echo $modelClass; ?> model.
|
* <?=$controllerClass; ?> implements the CRUD actions for <?=$modelClass; ?> model.
|
||||||
*/
|
*/
|
||||||
class <?php echo $controllerClass; ?> extends <?php echo StringHelper::basename($generator->baseControllerClass) . "\n"; ?>
|
class <?=$controllerClass; ?> extends <?=StringHelper::basename($generator->baseControllerClass) . "\n"; ?>
|
||||||
{
|
{
|
||||||
public function behaviors()
|
public function behaviors()
|
||||||
{
|
{
|
||||||
@@ -48,12 +48,12 @@ class <?php echo $controllerClass; ?> extends <?php echo StringHelper::basename(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all <?php echo $modelClass; ?> models.
|
* Lists all <?=$modelClass; ?> models.
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function actionIndex()
|
public function actionIndex()
|
||||||
{
|
{
|
||||||
$searchModel = new <?php echo $searchModelClass; ?>;
|
$searchModel = new <?=$searchModelClass; ?>;
|
||||||
$dataProvider = $searchModel->search($_GET);
|
$dataProvider = $searchModel->search($_GET);
|
||||||
|
|
||||||
return $this->render('index', array(
|
return $this->render('index', array(
|
||||||
@@ -63,28 +63,28 @@ class <?php echo $controllerClass; ?> extends <?php echo StringHelper::basename(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a single <?php echo $modelClass; ?> model.
|
* Displays a single <?=$modelClass; ?> model.
|
||||||
* <?php echo implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
* <?=implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function actionView(<?php echo $actionParams; ?>)
|
public function actionView(<?=$actionParams; ?>)
|
||||||
{
|
{
|
||||||
return $this->render('view', array(
|
return $this->render('view', array(
|
||||||
'model' => $this->findModel(<?php echo $actionParams; ?>),
|
'model' => $this->findModel(<?=$actionParams; ?>),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new <?php echo $modelClass; ?> model.
|
* Creates a new <?=$modelClass; ?> model.
|
||||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function actionCreate()
|
public function actionCreate()
|
||||||
{
|
{
|
||||||
$model = new <?php echo $modelClass; ?>;
|
$model = new <?=$modelClass; ?>;
|
||||||
|
|
||||||
if ($model->load($_POST) && $model->save()) {
|
if ($model->load($_POST) && $model->save()) {
|
||||||
return $this->redirect(array('view', <?php echo $urlParams; ?>));
|
return $this->redirect(array('view', <?=$urlParams; ?>));
|
||||||
} else {
|
} else {
|
||||||
return $this->render('create', array(
|
return $this->render('create', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
@@ -93,17 +93,17 @@ class <?php echo $controllerClass; ?> extends <?php echo StringHelper::basename(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an existing <?php echo $modelClass; ?> model.
|
* Updates an existing <?=$modelClass; ?> model.
|
||||||
* If update is successful, the browser will be redirected to the 'view' page.
|
* If update is successful, the browser will be redirected to the 'view' page.
|
||||||
* <?php echo implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
* <?=implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function actionUpdate(<?php echo $actionParams; ?>)
|
public function actionUpdate(<?=$actionParams; ?>)
|
||||||
{
|
{
|
||||||
$model = $this->findModel(<?php echo $actionParams; ?>);
|
$model = $this->findModel(<?=$actionParams; ?>);
|
||||||
|
|
||||||
if ($model->load($_POST) && $model->save()) {
|
if ($model->load($_POST) && $model->save()) {
|
||||||
return $this->redirect(array('view', <?php echo $urlParams; ?>));
|
return $this->redirect(array('view', <?=$urlParams; ?>));
|
||||||
} else {
|
} else {
|
||||||
return $this->render('update', array(
|
return $this->render('update', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
@@ -112,25 +112,25 @@ class <?php echo $controllerClass; ?> extends <?php echo StringHelper::basename(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes an existing <?php echo $modelClass; ?> model.
|
* Deletes an existing <?=$modelClass; ?> model.
|
||||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||||
* <?php echo implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
* <?=implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function actionDelete(<?php echo $actionParams; ?>)
|
public function actionDelete(<?=$actionParams; ?>)
|
||||||
{
|
{
|
||||||
$this->findModel(<?php echo $actionParams; ?>)->delete();
|
$this->findModel(<?=$actionParams; ?>)->delete();
|
||||||
return $this->redirect(array('index'));
|
return $this->redirect(array('index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the <?php echo $modelClass; ?> model based on its primary key value.
|
* Finds the <?=$modelClass; ?> model based on its primary key value.
|
||||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||||
* <?php echo implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
* <?=implode("\n\t * ", $actionParamComments) . "\n"; ?>
|
||||||
* @return <?php echo $modelClass; ?> the loaded model
|
* @return <?=$modelClass; ?> the loaded model
|
||||||
* @throws HttpException if the model cannot be found
|
* @throws HttpException if the model cannot be found
|
||||||
*/
|
*/
|
||||||
protected function findModel(<?php echo $actionParams; ?>)
|
protected function findModel(<?=$actionParams; ?>)
|
||||||
{
|
{
|
||||||
<?php
|
<?php
|
||||||
if (count($pks) === 1) {
|
if (count($pks) === 1) {
|
||||||
@@ -143,7 +143,7 @@ if (count($pks) === 1) {
|
|||||||
$condition = 'array(' . implode(', ', $condition) . ')';
|
$condition = 'array(' . implode(', ', $condition) . ')';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
if (($model = <?php echo $modelClass; ?>::find(<?php echo $condition; ?>)) !== null) {
|
if (($model = <?=$modelClass; ?>::find(<?=$condition; ?>)) !== null) {
|
||||||
return $model;
|
return $model;
|
||||||
} else {
|
} else {
|
||||||
throw new HttpException(404, 'The requested page does not exist.');
|
throw new HttpException(404, 'The requested page does not exist.');
|
||||||
|
|||||||
@@ -19,23 +19,23 @@ $searchConditions = $generator->generateSearchConditions();
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
namespace <?php echo StringHelper::dirname(ltrim($generator->searchModelClass, '\\')); ?>;
|
namespace <?=StringHelper::dirname(ltrim($generator->searchModelClass, '\\')); ?>;
|
||||||
|
|
||||||
use yii\base\Model;
|
use yii\base\Model;
|
||||||
use yii\data\ActiveDataProvider;
|
use yii\data\ActiveDataProvider;
|
||||||
use <?php echo ltrim($generator->modelClass, '\\'); ?>;
|
use <?=ltrim($generator->modelClass, '\\'); ?>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <?php echo $searchModelClass; ?> represents the model behind the search form about <?php echo $modelClass; ?>.
|
* <?=$searchModelClass; ?> represents the model behind the search form about <?=$modelClass; ?>.
|
||||||
*/
|
*/
|
||||||
class <?php echo $searchModelClass; ?> extends Model
|
class <?=$searchModelClass; ?> extends Model
|
||||||
{
|
{
|
||||||
public $<?php echo implode(";\n\tpublic $", $searchAttributes); ?>;
|
public $<?=implode(";\n\tpublic $", $searchAttributes); ?>;
|
||||||
|
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
<?php echo implode(",\n\t\t\t", $rules); ?>,
|
<?=implode(",\n\t\t\t", $rules); ?>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,14 +46,14 @@ class <?php echo $searchModelClass; ?> extends Model
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
<?php foreach ($labels as $name => $label): ?>
|
<?php foreach ($labels as $name => $label): ?>
|
||||||
<?php echo "'$name' => '" . addslashes($label) . "',\n"; ?>
|
<?="'$name' => '" . addslashes($label) . "',\n"; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search($params)
|
public function search($params)
|
||||||
{
|
{
|
||||||
$query = <?php echo $modelClass; ?>::find();
|
$query = <?=$modelClass; ?>::find();
|
||||||
$dataProvider = new ActiveDataProvider(array(
|
$dataProvider = new ActiveDataProvider(array(
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
));
|
));
|
||||||
@@ -62,7 +62,7 @@ class <?php echo $searchModelClass; ?> extends Model
|
|||||||
return $dataProvider;
|
return $dataProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php echo implode("\n\t\t", $searchConditions); ?>
|
<?=implode("\n\t\t", $searchConditions); ?>
|
||||||
|
|
||||||
return $dataProvider;
|
return $dataProvider;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,22 +23,22 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo ltrim($generator->modelClass, '\\'); ?> $model
|
* @var <?=ltrim($generator->modelClass, '\\'); ?> $model
|
||||||
* @var yii\widgets\ActiveForm $form
|
* @var yii\widgets\ActiveForm $form
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-form">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-form">
|
||||||
|
|
||||||
<?php echo '<?php'; ?> $form = ActiveForm::begin(); ?>
|
<?='<?php'; ?> $form = ActiveForm::begin(); ?>
|
||||||
|
|
||||||
<?php foreach ($safeAttributes as $attribute) {
|
<?php foreach ($safeAttributes as $attribute) {
|
||||||
echo "\t\t<?php echo " . $generator->generateActiveField($attribute) . " ?>\n\n";
|
echo "\t\t<?=" . $generator->generateActiveField($attribute) . " ?>\n\n";
|
||||||
} ?>
|
} ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo '<?php'; ?> echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', array('class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary')); ?>
|
<?='<?php'; ?> echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', array('class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary')); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo '<?php'; ?> ActiveForm::end(); ?>
|
<?='<?php'; ?> ActiveForm::end(); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo ltrim($generator->searchModelClass, '\\'); ?> $model
|
* @var <?=ltrim($generator->searchModelClass, '\\'); ?> $model
|
||||||
* @var yii\widgets\ActiveForm $form
|
* @var yii\widgets\ActiveForm $form
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-search">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-search">
|
||||||
|
|
||||||
<?php echo '<?php'; ?> $form = ActiveForm::begin(array(
|
<?='<?php'; ?> $form = ActiveForm::begin(array(
|
||||||
'action' => array('index'),
|
'action' => array('index'),
|
||||||
'method' => 'get',
|
'method' => 'get',
|
||||||
)); ?>
|
)); ?>
|
||||||
@@ -32,17 +32,17 @@ use yii\widgets\ActiveForm;
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($generator->getTableSchema()->getColumnNames() as $attribute) {
|
foreach ($generator->getTableSchema()->getColumnNames() as $attribute) {
|
||||||
if (++$count < 6) {
|
if (++$count < 6) {
|
||||||
echo "\t\t<?php echo " . $generator->generateActiveSearchField($attribute) . " ?>\n";
|
echo "\t\t<?=" . $generator->generateActiveSearchField($attribute) . " ?>\n";
|
||||||
} else {
|
} else {
|
||||||
echo "\t\t<?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n";
|
echo "\t\t<?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo '<?php'; ?> echo Html::submitButton('Search', array('class' => 'btn btn-primary')); ?>
|
<?='<?php'; ?> echo Html::submitButton('Search', array('class' => 'btn btn-primary')); ?>
|
||||||
<?php echo '<?php'; ?> echo Html::resetButton('Reset', array('class' => 'btn btn-default')); ?>
|
<?='<?php'; ?> echo Html::resetButton('Reset', array('class' => 'btn btn-default')); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo '<?php'; ?> ActiveForm::end(); ?>
|
<?='<?php'; ?> ActiveForm::end(); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,18 +15,18 @@ use yii\helpers\Html;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo ltrim($generator->modelClass, '\\'); ?> $model
|
* @var <?=ltrim($generator->modelClass, '\\'); ?> $model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->title = 'Create <?php echo Inflector::camel2words(StringHelper::basename($generator->modelClass)); ?>';
|
$this->title = 'Create <?=Inflector::camel2words(StringHelper::basename($generator->modelClass)); ?>';
|
||||||
$this->params['breadcrumbs'][] = array('label' => '<?php echo Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
$this->params['breadcrumbs'][] = array('label' => '<?=Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-create">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-create">
|
||||||
|
|
||||||
<h1><?php echo "<?php"; ?> echo Html::encode($this->title); ?></h1>
|
<h1><?="<?php"; ?> echo Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<?php echo "<?php"; ?> echo $this->render('_form', array(
|
<?="<?php"; ?> echo $this->render('_form', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
|
|||||||
@@ -15,29 +15,29 @@ echo "<?php\n";
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use <?php echo $generator->indexWidgetType === 'grid' ? 'yii\grid\GridView' : 'yii\widgets\ListView'; ?>;
|
use <?=$generator->indexWidgetType === 'grid' ? 'yii\grid\GridView' : 'yii\widgets\ListView'; ?>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var yii\data\ActiveDataProvider $dataProvider
|
* @var yii\data\ActiveDataProvider $dataProvider
|
||||||
* @var <?php echo ltrim($generator->searchModelClass, '\\'); ?> $searchModel
|
* @var <?=ltrim($generator->searchModelClass, '\\'); ?> $searchModel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->title = '<?php echo Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>';
|
$this->title = '<?=Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>';
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-index">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-index">
|
||||||
|
|
||||||
<h1><?php echo "<?php"; ?> echo Html::encode($this->title); ?></h1>
|
<h1><?="<?php"; ?> echo Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<?php echo '<?php' . ($generator->indexWidgetType === 'grid' ? ' //' : ''); ?> echo $this->render('_search', array('model' => $searchModel)); ?>
|
<?='<?php' . ($generator->indexWidgetType === 'grid' ? ' //' : ''); ?> echo $this->render('_search', array('model' => $searchModel)); ?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php echo '<?php'; ?> echo Html::a('Create <?php echo StringHelper::basename($generator->modelClass); ?>', array('create'), array('class' => 'btn btn-success')); ?>
|
<?='<?php'; ?> echo Html::a('Create <?=StringHelper::basename($generator->modelClass); ?>', array('create'), array('class' => 'btn btn-success')); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php if ($generator->indexWidgetType === 'grid'): ?>
|
<?php if ($generator->indexWidgetType === 'grid'): ?>
|
||||||
<?php echo "<?php"; ?> echo GridView::widget(array(
|
<?="<?php"; ?> echo GridView::widget(array(
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
'filterModel' => $searchModel,
|
'filterModel' => $searchModel,
|
||||||
'columns' => array(
|
'columns' => array(
|
||||||
@@ -59,13 +59,13 @@ foreach ($generator->getTableSchema()->columns as $column) {
|
|||||||
),
|
),
|
||||||
)); ?>
|
)); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo "<?php"; ?> echo ListView::widget(array(
|
<?="<?php"; ?> echo ListView::widget(array(
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
'itemOptions' => array(
|
'itemOptions' => array(
|
||||||
'class' => 'item',
|
'class' => 'item',
|
||||||
),
|
),
|
||||||
'itemView' => function ($model, $key, $index, $widget) {
|
'itemView' => function ($model, $key, $index, $widget) {
|
||||||
return Html::a(Html::encode($model-><?php echo $nameAttribute; ?>), array('view', <?php echo $urlParams; ?>));
|
return Html::a(Html::encode($model-><?=$nameAttribute; ?>), array('view', <?=$urlParams; ?>));
|
||||||
},
|
},
|
||||||
)); ?>
|
)); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -17,19 +17,19 @@ use yii\helpers\Html;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo ltrim($generator->modelClass, '\\'); ?> $model
|
* @var <?=ltrim($generator->modelClass, '\\'); ?> $model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->title = 'Update <?php echo Inflector::camel2words(StringHelper::basename($generator->modelClass)); ?>: ' . $model-><?php echo $generator->getNameAttribute(); ?>;
|
$this->title = 'Update <?=Inflector::camel2words(StringHelper::basename($generator->modelClass)); ?>: ' . $model-><?=$generator->getNameAttribute(); ?>;
|
||||||
$this->params['breadcrumbs'][] = array('label' => '<?php echo Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
$this->params['breadcrumbs'][] = array('label' => '<?=Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
||||||
$this->params['breadcrumbs'][] = array('label' => $model-><?php echo $generator->getNameAttribute(); ?>, 'url' => array('view', <?php echo $urlParams; ?>));
|
$this->params['breadcrumbs'][] = array('label' => $model-><?=$generator->getNameAttribute(); ?>, 'url' => array('view', <?=$urlParams; ?>));
|
||||||
$this->params['breadcrumbs'][] = 'Update';
|
$this->params['breadcrumbs'][] = 'Update';
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-update">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-update">
|
||||||
|
|
||||||
<h1><?php echo "<?php"; ?> echo Html::encode($this->title); ?></h1>
|
<h1><?="<?php"; ?> echo Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<?php echo "<?php"; ?> echo $this->render('_form', array(
|
<?="<?php"; ?> echo $this->render('_form', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
|
|||||||
@@ -18,27 +18,27 @@ use yii\widgets\DetailView;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo ltrim($generator->modelClass, '\\'); ?> $model
|
* @var <?=ltrim($generator->modelClass, '\\'); ?> $model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->title = $model-><?php echo $generator->getNameAttribute(); ?>;
|
$this->title = $model-><?=$generator->getNameAttribute(); ?>;
|
||||||
$this->params['breadcrumbs'][] = array('label' => '<?php echo Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
$this->params['breadcrumbs'][] = array('label' => '<?=Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass))); ?>', 'url' => array('index'));
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-view">
|
<div class="<?=Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-view">
|
||||||
|
|
||||||
<h1><?php echo "<?php"; ?> echo Html::encode($this->title); ?></h1>
|
<h1><?="<?php"; ?> echo Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<?php echo '<?php'; ?> echo Html::a('Update', array('update', <?php echo $urlParams; ?>), array('class' => 'btn btn-primary')); ?>
|
<?='<?php'; ?> echo Html::a('Update', array('update', <?=$urlParams; ?>), array('class' => 'btn btn-primary')); ?>
|
||||||
<?php echo '<?php'; ?> echo Html::a('Delete', array('delete', <?php echo $urlParams; ?>), array(
|
<?='<?php'; ?> echo Html::a('Delete', array('delete', <?=$urlParams; ?>), array(
|
||||||
'class' => 'btn btn-danger',
|
'class' => 'btn btn-danger',
|
||||||
'data-confirm' => Yii::t('app', 'Are you sure to delete this item?'),
|
'data-confirm' => Yii::t('app', 'Are you sure to delete this item?'),
|
||||||
'data-method' => 'post',
|
'data-method' => 'post',
|
||||||
)); ?>
|
)); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php echo '<?php'; ?> echo DetailView::widget(array(
|
<?='<?php'; ?> echo DetailView::widget(array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ use yii\helpers\Inflector;
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
public function action<?php echo Inflector::id2camel(trim(basename($generator->viewName), '_')); ?>()
|
public function action<?=Inflector::id2camel(trim(basename($generator->viewName), '_')); ?>()
|
||||||
{
|
{
|
||||||
$model = new <?php echo $generator->modelClass; ?><?php echo empty($generator->scenarioName) ? '' : "(array('scenario' => '{$generator->scenarioName}'))"; ?>;
|
$model = new <?=$generator->modelClass; ?><?=empty($generator->scenarioName) ? '' : "(array('scenario' => '{$generator->scenarioName}'))"; ?>;
|
||||||
|
|
||||||
if ($model->load($_POST)) {
|
if ($model->load($_POST)) {
|
||||||
if($model->validate()) {
|
if($model->validate()) {
|
||||||
@@ -22,7 +22,7 @@ public function action<?php echo Inflector::id2camel(trim(basename($generator->v
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->render('<?php echo $generator->viewName; ?>', array(
|
return $this->render('<?=$generator->viewName; ?>', array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,22 +14,22 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var yii\base\View $this
|
* @var yii\base\View $this
|
||||||
* @var <?php echo $generator->modelClass; ?> $model
|
* @var <?=$generator->modelClass; ?> $model
|
||||||
* @var ActiveForm $form
|
* @var ActiveForm $form
|
||||||
*/
|
*/
|
||||||
<?php echo "?>"; ?>
|
<?="?>"; ?>
|
||||||
|
|
||||||
<div class="<?php echo str_replace('/', '-', trim($generator->viewName, '_')); ?>">
|
<div class="<?=str_replace('/', '-', trim($generator->viewName, '_')); ?>">
|
||||||
|
|
||||||
<?php echo '<?php'; ?> $form = ActiveForm::begin(); ?>
|
<?='<?php'; ?> $form = ActiveForm::begin(); ?>
|
||||||
|
|
||||||
<?php foreach ($generator->getModelAttributes() as $attribute): ?>
|
<?php foreach ($generator->getModelAttributes() as $attribute): ?>
|
||||||
<?php echo '<?php'; ?> echo $form->field($model, '<?php echo $attribute; ?>'); ?>
|
<?='<?php'; ?> echo $form->field($model, '<?=$attribute; ?>'); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo '<?php'; ?> echo Html::submitButton('Submit', array('class' => 'btn btn-primary')); ?>
|
<?='<?php'; ?> echo Html::submitButton('Submit', array('class' => 'btn btn-primary')); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php echo '<?php'; ?> ActiveForm::end(); ?>
|
<?='<?php'; ?> ActiveForm::end(); ?>
|
||||||
|
|
||||||
</div><!-- <?php echo str_replace('/', '-', trim($generator->viewName, '-')); ?> -->
|
</div><!-- <?=str_replace('/', '-', trim($generator->viewName, '-')); ?> -->
|
||||||
|
|||||||
@@ -15,29 +15,29 @@
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
namespace <?php echo $generator->ns; ?>;
|
namespace <?=$generator->ns; ?>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the model class for table "<?php echo $tableName; ?>".
|
* This is the model class for table "<?=$tableName; ?>".
|
||||||
*
|
*
|
||||||
<?php foreach ($tableSchema->columns as $column): ?>
|
<?php foreach ($tableSchema->columns as $column): ?>
|
||||||
* @property <?php echo "{$column->phpType} \${$column->name}\n"; ?>
|
* @property <?="{$column->phpType} \${$column->name}\n"; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if (!empty($relations)): ?>
|
<?php if (!empty($relations)): ?>
|
||||||
*
|
*
|
||||||
<?php foreach ($relations as $name => $relation): ?>
|
<?php foreach ($relations as $name => $relation): ?>
|
||||||
* @property <?php echo $relation[1] . ($relation[2] ? '[]' : '') . ' $' . lcfirst($name) . "\n"; ?>
|
* @property <?=$relation[1] . ($relation[2] ? '[]' : '') . ' $' . lcfirst($name) . "\n"; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
*/
|
*/
|
||||||
class <?php echo $className; ?> extends <?php echo '\\' . ltrim($generator->baseClass, '\\') . "\n"; ?>
|
class <?=$className; ?> extends <?='\\' . ltrim($generator->baseClass, '\\') . "\n"; ?>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public static function tableName()
|
public static function tableName()
|
||||||
{
|
{
|
||||||
return '<?php echo $tableName; ?>';
|
return '<?=$tableName; ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +45,7 @@ class <?php echo $className; ?> extends <?php echo '\\' . ltrim($generator->base
|
|||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return array(<?php echo "\n\t\t\t" . implode(",\n\t\t\t", $rules) . "\n\t\t"; ?>);
|
return array(<?="\n\t\t\t" . implode(",\n\t\t\t", $rules) . "\n\t\t"; ?>);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,7 +55,7 @@ class <?php echo $className; ?> extends <?php echo '\\' . ltrim($generator->base
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
<?php foreach ($labels as $name => $label): ?>
|
<?php foreach ($labels as $name => $label): ?>
|
||||||
<?php echo "'$name' => '" . addslashes($label) . "',\n"; ?>
|
<?="'$name' => '" . addslashes($label) . "',\n"; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -64,9 +64,9 @@ class <?php echo $className; ?> extends <?php echo '\\' . ltrim($generator->base
|
|||||||
/**
|
/**
|
||||||
* @return \yii\db\ActiveRelation
|
* @return \yii\db\ActiveRelation
|
||||||
*/
|
*/
|
||||||
public function get<?php echo $name; ?>()
|
public function get<?=$name; ?>()
|
||||||
{
|
{
|
||||||
<?php echo $relation[0] . "\n"; ?>
|
<?=$relation[0] . "\n"; ?>
|
||||||
}
|
}
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
namespace <?php echo $generator->getControllerNamespace(); ?>;
|
namespace <?=$generator->getControllerNamespace(); ?>;
|
||||||
|
|
||||||
use yii\web\Controller;
|
use yii\web\Controller;
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ $className = substr($className, $pos + 1);
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
namespace <?php echo $ns; ?>;
|
namespace <?=$ns; ?>;
|
||||||
|
|
||||||
|
|
||||||
class <?php echo $className; ?> extends \yii\base\Module
|
class <?=$className; ?> extends \yii\base\Module
|
||||||
{
|
{
|
||||||
public $controllerNamespace = '<?php echo $generator->getControllerNamespace(); ?>';
|
public $controllerNamespace = '<?=$generator->getControllerNamespace(); ?>';
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
* @var yii\gii\generators\module\Generator $generator
|
* @var yii\gii\generators\module\Generator $generator
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo $generator->moduleID . '-default-index'; ?>">
|
<div class="<?=$generator->moduleID . '-default-index'; ?>">
|
||||||
<h1><?php echo "<?php"; ?> echo $this->context->action->uniqueId; ?></h1>
|
<h1><?="<?php"; ?> echo $this->context->action->uniqueId; ?></h1>
|
||||||
<p>
|
<p>
|
||||||
This is the view content for action "<?php echo "<?php"; ?> echo $this->context->action->id; ?>".
|
This is the view content for action "<?="<?php"; ?> echo $this->context->action->id; ?>".
|
||||||
The action belongs to the controller "<?php echo "<?php"; ?> echo get_class($this->context); ?>"
|
The action belongs to the controller "<?="<?php"; ?> echo get_class($this->context); ?>"
|
||||||
in the "<?php echo "<?php"; ?> echo $this->context->module->id; ?>" module.
|
in the "<?="<?php"; ?> echo $this->context->module->id; ?>" module.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You may customize this page by editing the following file:<br>
|
You may customize this page by editing the following file:<br>
|
||||||
<code><?php echo "<?php"; ?> echo __FILE__; ?></code>
|
<code><?="<?php"; ?> echo __FILE__; ?></code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
<?php elseif (empty($diff)): ?>
|
<?php elseif (empty($diff)): ?>
|
||||||
<div class="alert alert-success">Identical.</div>
|
<div class="alert alert-success">Identical.</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="content"><?php echo $diff; ?></div>
|
<div class="content"><?=$diff; ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ $this->title = 'Welcome to Gii';
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<?php foreach ($generators as $id => $generator): ?>
|
<?php foreach ($generators as $id => $generator): ?>
|
||||||
<div class="generator col-lg-4">
|
<div class="generator col-lg-4">
|
||||||
<h3><?php echo Html::encode($generator->getName()); ?></h3>
|
<h3><?=Html::encode($generator->getName()); ?></h3>
|
||||||
<p><?php echo $generator->getDescription(); ?></p>
|
<p><?=$generator->getDescription(); ?></p>
|
||||||
<p><?php echo Html::a('Start »', array('default/view', 'id' => $id), array('class' => 'btn btn-default')); ?></p>
|
<p><?=Html::a('Start »', array('default/view', 'id' => $id), array('class' => 'btn btn-default')); ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ foreach ($generator->templates as $name => $path) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="default-view">
|
<div class="default-view">
|
||||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
<h1><?=Html::encode($this->title); ?></h1>
|
||||||
|
|
||||||
<p><?php echo $generator->getDescription(); ?></p>
|
<p><?=$generator->getDescription(); ?></p>
|
||||||
|
|
||||||
<?php $form = ActiveForm::begin(array(
|
<?php $form = ActiveForm::begin(array(
|
||||||
'id' => "$id-generator",
|
'id' => "$id-generator",
|
||||||
@@ -35,20 +35,20 @@ foreach ($generator->templates as $name => $path) {
|
|||||||
)); ?>
|
)); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<?php echo $this->renderFile($generator->formView(), array(
|
<?=$this->renderFile($generator->formView(), array(
|
||||||
'generator' => $generator,
|
'generator' => $generator,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
)); ?>
|
)); ?>
|
||||||
<?php echo $form->field($generator, 'template')->sticky()
|
<?=$form->field($generator, 'template')->sticky()
|
||||||
->label('Code Template')
|
->label('Code Template')
|
||||||
->dropDownList($templates)->hint('
|
->dropDownList($templates)->hint('
|
||||||
Please select which set of the templates should be used to generated the code.
|
Please select which set of the templates should be used to generated the code.
|
||||||
'); ?>
|
'); ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php echo Html::submitButton('Preview', array('name' => 'preview', 'class' => 'btn btn-primary')); ?>
|
<?=Html::submitButton('Preview', array('name' => 'preview', 'class' => 'btn btn-primary')); ?>
|
||||||
|
|
||||||
<?php if(isset($files)): ?>
|
<?php if(isset($files)): ?>
|
||||||
<?php echo Html::submitButton('Generate', array('name' => 'generate', 'class' => 'btn btn-success')); ?>
|
<?=Html::submitButton('Generate', array('name' => 'generate', 'class' => 'btn btn-success')); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ use yii\gii\CodeFile;
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($files as $file): ?>
|
<?php foreach ($files as $file): ?>
|
||||||
<tr class="<?php echo $file->operation; ?>">
|
<tr class="<?=$file->operation; ?>">
|
||||||
<td class="file">
|
<td class="file">
|
||||||
<?php echo Html::a(Html::encode($file->getRelativePath()), array('preview', 'file' => $file->id), array('class' => 'preview-code', 'data-title' => $file->getRelativePath())); ?>
|
<?=Html::a(Html::encode($file->getRelativePath()), array('preview', 'file' => $file->id), array('class' => 'preview-code', 'data-title' => $file->getRelativePath())); ?>
|
||||||
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
|
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
|
||||||
<?php echo Html::a('diff', array('diff', 'file' => $file->id), array('class' => 'diff-code label label-warning', 'data-title' => $file->getRelativePath())); ?>
|
<?=Html::a('diff', array('diff', 'file' => $file->id), array('class' => 'diff-code label label-warning', 'data-title' => $file->getRelativePath())); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ use yii\gii\CodeFile;
|
|||||||
echo '<div class="alert alert-success">' . $generator->successMessage() . '</div>';
|
echo '<div class="alert alert-success">' . $generator->successMessage() . '</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<pre><?php echo nl2br($results); ?></pre>
|
<pre><?=nl2br($results); ?></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ $activeGenerator = Yii::$app->controller->generator;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-9">
|
<div class="col-lg-9">
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php $this->endContent(); ?>
|
<?php $this->endContent(); ?>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ $asset = yii\gii\GiiAsset::register($this);
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title><?php echo Html::encode($this->title); ?></title>
|
<title><?=Html::encode($this->title); ?></title>
|
||||||
<?php $this->head(); ?>
|
<?php $this->head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -39,13 +39,13 @@ NavBar::end();
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="pull-left">A Product of <a href="http://www.yiisoft.com/">Yii Software LLC</a></p>
|
<p class="pull-left">A Product of <a href="http://www.yiisoft.com/">Yii Software LLC</a></p>
|
||||||
<p class="pull-right"><?php echo Yii::powered(); ?></p>
|
<p class="pull-right"><?=Yii::powered(); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -52,18 +52,18 @@
|
|||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr><th>Name</th><th>Result</th><th>Required By</th><th>Memo</th></tr>
|
<tr><th>Name</th><th>Result</th><th>Required By</th><th>Memo</th></tr>
|
||||||
<?php foreach($requirements as $requirement): ?>
|
<?php foreach($requirements as $requirement): ?>
|
||||||
<tr class="<?php echo $requirement['condition'] ? 'success' : ($requirement['mandatory'] ? 'error' : 'warning'); ?>">
|
<tr class="<?=$requirement['condition'] ? 'success' : ($requirement['mandatory'] ? 'error' : 'warning'); ?>">
|
||||||
<td>
|
<td>
|
||||||
<?php echo $requirement['name']; ?>
|
<?=$requirement['name']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="result"><?php echo $requirement['condition'] ? 'Passed' : ($requirement['mandatory'] ? 'Failed' : 'Warning'); ?></span>
|
<span class="result"><?=$requirement['condition'] ? 'Passed' : ($requirement['mandatory'] ? 'Failed' : 'Warning'); ?></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $requirement['by']; ?>
|
<?=$requirement['by']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $requirement['memo']; ?>
|
<?=$requirement['memo']; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>Server: <?php echo $this->getServerInfo() . ' ' . $this->getNowDate(); ?></p>
|
<p>Server: <?=$this->getServerInfo() . ' ' . $this->getNowDate(); ?></p>
|
||||||
<p>Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></p>
|
<p>Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,15 +12,15 @@
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<li class="<?php if (!$handler->isCoreFile($file) || $index === 1) echo 'application'; ?> call-stack-item"
|
<li class="<?php if (!$handler->isCoreFile($file) || $index === 1) echo 'application'; ?> call-stack-item"
|
||||||
data-line="<?php echo (int)($line - $begin); ?>">
|
data-line="<?=(int)($line - $begin); ?>">
|
||||||
<div class="element-wrap">
|
<div class="element-wrap">
|
||||||
<div class="element">
|
<div class="element">
|
||||||
<span class="item-number"><?php echo (int)$index; ?>.</span>
|
<span class="item-number"><?=(int)$index; ?>.</span>
|
||||||
<span class="text"><?php if ($file !== null) echo 'in ' . $handler->htmlEncode($file); ?></span>
|
<span class="text"><?php if ($file !== null) echo 'in ' . $handler->htmlEncode($file); ?></span>
|
||||||
<?php if ($method !== null): ?>
|
<?php if ($method !== null): ?>
|
||||||
<span class="call">
|
<span class="call">
|
||||||
<?php if ($file !== null) echo '–' ?>
|
<?php if ($file !== null) echo '–' ?>
|
||||||
<?php if ($class !== null) echo $handler->addTypeLinks($class) . '::'; ?><?php echo $handler->addTypeLinks($method . '()'); ?>
|
<?php if ($class !== null) echo $handler->addTypeLinks($class) . '::'; ?><?=$handler->addTypeLinks($method . '()'); ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
|
<span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<div class="error-line"></div>
|
<div class="error-line"></div>
|
||||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
|
<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?php echo (int)($i + 1); ?></span><?php endfor; ?>
|
<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?=(int)($i + 1); ?></span><?php endfor; ?>
|
||||||
<pre><?php
|
<pre><?php
|
||||||
// fill empty lines with a whitespace to avoid rendering problems in opera
|
// fill empty lines with a whitespace to avoid rendering problems in opera
|
||||||
for ($i = $begin; $i <= $end; ++$i) {
|
for ($i = $begin; $i <= $end; ++$i) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if ($exception instanceof \yii\base\UserException) {
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title><?php echo $handler->htmlEncode($name); ?></title>
|
<title><?=$handler->htmlEncode($name); ?></title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -69,8 +69,8 @@ if ($exception instanceof \yii\base\UserException) {
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1><?php echo $handler->htmlEncode($name); ?></h1>
|
<h1><?=$handler->htmlEncode($name); ?></h1>
|
||||||
<h2><?php echo nl2br($handler->htmlEncode($message)); ?></h2>
|
<h2><?=nl2br($handler->htmlEncode($message)); ?></h2>
|
||||||
<p>
|
<p>
|
||||||
The above error occurred while the Web server was processing your request.
|
The above error occurred while the Web server was processing your request.
|
||||||
</p>
|
</p>
|
||||||
@@ -78,7 +78,7 @@ if ($exception instanceof \yii\base\UserException) {
|
|||||||
Please contact us if you think this is a server error. Thank you.
|
Please contact us if you think this is a server error. Thank you.
|
||||||
</p>
|
</p>
|
||||||
<div class="version">
|
<div class="version">
|
||||||
<?php echo date('Y-m-d H:i:s', time()); ?>
|
<?=date('Y-m-d H:i:s', time()); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if (method_exists($this, 'endBody')) $this->endBody(); // to allow injecting code into body (mostly by Yii Debug Toolbar) ?>
|
<?php if (method_exists($this, 'endBody')) $this->endBody(); // to allow injecting code into body (mostly by Yii Debug Toolbar) ?>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -9,13 +9,13 @@
|
|||||||
<h2>
|
<h2>
|
||||||
<span>Caused by:</span>
|
<span>Caused by:</span>
|
||||||
<?php if ($exception instanceof \yii\base\Exception): ?>
|
<?php if ($exception instanceof \yii\base\Exception): ?>
|
||||||
<span><?php echo $handler->htmlEncode($exception->getName()); ?></span> –
|
<span><?=$handler->htmlEncode($exception->getName()); ?></span> –
|
||||||
<?php echo $handler->addTypeLinks(get_class($exception)); ?>
|
<?=$handler->addTypeLinks(get_class($exception)); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<span><?php echo $handler->htmlEncode(get_class($exception)); ?></span>
|
<span><?=$handler->htmlEncode(get_class($exception)); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</h2>
|
</h2>
|
||||||
<h3><?php echo $handler->htmlEncode($exception->getMessage()); ?></h3>
|
<h3><?=$handler->htmlEncode($exception->getMessage()); ?></h3>
|
||||||
<p>in <span class="file"><?php echo $exception->getFile(); ?></span> at line <span class="line"><?php echo $exception->getLine(); ?></span></p>
|
<p>in <span class="file"><?=$exception->getFile(); ?></span> at line <span class="line"><?=$exception->getLine(); ?></span></p>
|
||||||
<?php echo $handler->renderPreviousExceptions($exception); ?>
|
<?=$handler->renderPreviousExceptions($exception); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
echo "<?php\n";
|
echo "<?php\n";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
class <?php echo $className; ?> extends \yii\db\Migration
|
class <?=$className; ?> extends \yii\db\Migration
|
||||||
{
|
{
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ class <?php echo $className; ?> extends \yii\db\Migration
|
|||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
echo "<?php echo $className; ?> cannot be reverted.\n";
|
echo "<?=$className; ?> cannot be reverted.\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<?php $this->beginBody(); ?>
|
<?php $this->beginBody(); ?>
|
||||||
|
|
||||||
<?php echo $content; ?>
|
<?=$content; ?>
|
||||||
|
|
||||||
<?php $this->endBody(); ?>
|
<?php $this->endBody(); ?>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user