mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
Merge pull request #1054 from lucianobaraglia/master
GII - more short echo syntax
This commit is contained in:
@@ -14,7 +14,7 @@ echo "<?php\n";
|
|||||||
|
|
||||||
public function action<?= Inflector::id2camel(trim(basename($generator->viewName), '_')) ?>()
|
public function action<?= Inflector::id2camel(trim(basename($generator->viewName), '_')) ?>()
|
||||||
{
|
{
|
||||||
$model = new <?= $generator->modelClass ?><?= empty($generator->scenarioName) ? '' : "(['scenario' => '{$generator->scenarioName}'])" ?>;
|
$model = new <?= $generator->modelClass ?><?= empty($generator->scenarioName) ? "" : "(['scenario' => '{$generator->scenarioName}'])" ?>;
|
||||||
|
|
||||||
if ($model->load($_POST)) {
|
if ($model->load($_POST)) {
|
||||||
if($model->validate()) {
|
if($model->validate()) {
|
||||||
|
|||||||
@@ -21,15 +21,15 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
<div class="<?= str_replace('/', '-', trim($generator->viewName, '_')) ?>">
|
<div class="<?= str_replace('/', '-', trim($generator->viewName, '_')) ?>">
|
||||||
|
|
||||||
<?= '<?php' ?> $form = ActiveForm::begin(); ?>
|
<?= "<?php " ?>$form = ActiveForm::begin(); ?>
|
||||||
|
|
||||||
<?php foreach ($generator->getModelAttributes() as $attribute): ?>
|
<?php foreach ($generator->getModelAttributes() as $attribute): ?>
|
||||||
<?= '<?php' ?> echo $form->field($model, '<?= $attribute ?>'); ?>
|
<?= "<?= " ?>$form->field($model, '<?= $attribute ?>') ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<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><!-- <?= str_replace('/', '-', trim($generator->viewName, '-')) ?> -->
|
</div><!-- <?= str_replace('/', '-', trim($generator->viewName, '-')) ?> -->
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="<?= $generator->moduleID . '-default-index' ?>">
|
<div class="<?= $generator->moduleID . '-default-index' ?>">
|
||||||
<h1><?= "<?php" ?> echo $this->context->action->uniqueId; ?></h1>
|
<h1><?= "<?= " ?>$this->context->action->uniqueId ?></h1>
|
||||||
<p>
|
<p>
|
||||||
This is the view content for action "<?= "<?php" ?> echo $this->context->action->id; ?>".
|
This is the view content for action "<?= "<?= " ?>$this->context->action->id ?>".
|
||||||
The action belongs to the controller "<?= "<?php" ?> echo get_class($this->context); ?>"
|
The action belongs to the controller "<?= "<?= " ?>get_class($this->context) ?>"
|
||||||
in the "<?= "<?php" ?> echo $this->context->module->id; ?>" module.
|
in the "<?= "<?= " ?>$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 __FILE__; ?></code>
|
<code><?= "<?= " ?>__FILE__ ?></code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user