mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 02:13:17 +08:00
Merge branch 'master' of github.com:yiisoft/yii2
This commit is contained in:
@ -93,14 +93,14 @@ This will create all the `<label>`, `<input>` and other tags according to the te
|
||||
To add these tags yourself you can use the `Html` helper class. The following is equivalent to the code above:
|
||||
|
||||
```php
|
||||
<?= Html::activeLabel($model, 'password'); ?>
|
||||
<?= Html::activePasswordInput($model, 'password'); ?>
|
||||
<?= Html::error($model, 'password'); ?>
|
||||
<?= Html::activeLabel($model, 'password') ?>
|
||||
<?= Html::activePasswordInput($model, 'password') ?>
|
||||
<?= Html::error($model, 'password') ?>
|
||||
|
||||
or
|
||||
|
||||
<?= Html::activeLabel($model, 'username', ['label' => 'name']); ?>
|
||||
<?= Html::activeTextInput($model, 'username'); ?>
|
||||
<?= Html::error($model, 'username'); ?>
|
||||
<?= Html::activeLabel($model, 'username', ['label' => 'name']) ?>
|
||||
<?= Html::activeTextInput($model, 'username') ?>
|
||||
<?= Html::error($model, 'username') ?>
|
||||
<div class="hint-block">Please enter your name</div>
|
||||
```
|
||||
|
||||
@ -254,24 +254,24 @@ basic one without any widgets or extra markup.
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
?>
|
||||
<?php $this->beginPage(); ?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head(); ?>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php $this->beginBody(); ?>
|
||||
<?php $this->beginBody() ?>
|
||||
<div class="container">
|
||||
<?= $content ?>
|
||||
</div>
|
||||
<footer class="footer">© 2013 me :)</footer>
|
||||
<?php $this->endBody(); ?>
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage(); ?>
|
||||
<?php $this->endPage() ?>
|
||||
```
|
||||
|
||||
In the markup above there's some code. First of all, `$content` is a variable that will contain result of views rendered
|
||||
|
||||
Reference in New Issue
Block a user