Commit 6c80cba3 by larnu Committed by Carsten Brandt

update spanish helper-html.md

close #6578
parent ee67d164
...@@ -162,10 +162,10 @@ especifica directamente. ...@@ -162,10 +162,10 @@ especifica directamente.
Los métodos más genéricos son: Los métodos más genéricos son:
```php ```php
// type, input name, input value, options type, input name, input value, options
<?= Html::input('text', 'username', $user->name, ['class' => $username]) ?> <?= Html::input('text', 'username', $user->name, ['class' => $username]) ?>
// type, model, model attribute name, options type, model, model attribute name, options
<?= Html::activeInput('text', $user, 'name', ['class' => $username]) ?> <?= Html::activeInput('text', $user, 'name', ['class' => $username]) ?>
``` ```
...@@ -282,13 +282,13 @@ Existen dos métodos para generar etiquetas que envuelvan estilos y scripts incr ...@@ -282,13 +282,13 @@ Existen dos métodos para generar etiquetas que envuelvan estilos y scripts incr
```php ```php
<?= Html::style('.danger { color: #f00; }') ?> <?= Html::style('.danger { color: #f00; }') ?>
// Genera Genera
<style>.danger { color: #f00; }</style> <style>.danger { color: #f00; }</style>
<?= Html::script('alert("Hello!");', ['defer' => true]); <?= Html::script('alert("Hello!");', ['defer' => true]);
// Genera Genera
<script defer>alert("Hello!");</script> <script defer>alert("Hello!");</script>
``` ```
...@@ -298,7 +298,7 @@ Si se quiere enlazar un estilo externo desde un archivo CSS: ...@@ -298,7 +298,7 @@ Si se quiere enlazar un estilo externo desde un archivo CSS:
```php ```php
<?= Html::cssFile('@web/css/ie5.css', ['condition' => 'IE 5']) ?> <?= Html::cssFile('@web/css/ie5.css', ['condition' => 'IE 5']) ?>
// genera genera
<!--[if IE 5]> <!--[if IE 5]>
<link href="http://example.com/css/ie5.css" /> <link href="http://example.com/css/ie5.css" />
...@@ -351,7 +351,7 @@ Para generar una etiqueta de tipo imagen se puede usar el siguiente ejemplo: ...@@ -351,7 +351,7 @@ Para generar una etiqueta de tipo imagen se puede usar el siguiente ejemplo:
```php ```php
<?= Html::img('@web/images/logo.png', ['alt' => 'My logo']) ?> <?= Html::img('@web/images/logo.png', ['alt' => 'My logo']) ?>
// genera genera
<img src="http://example.com/images/logo.png" alt="My logo" /> <img src="http://example.com/images/logo.png" alt="My logo" />
``` ```
......
...@@ -9,6 +9,7 @@ of Html helper which provides a set of static methods for handling commonly used ...@@ -9,6 +9,7 @@ of Html helper which provides a set of static methods for handling commonly used
> Note: If your markup is nearly static it's better to use HTML directly. There's no need to wrap absolutely everything > Note: If your markup is nearly static it's better to use HTML directly. There's no need to wrap absolutely everything
with Html helper calls. with Html helper calls.
Basics <a name="basics"></a> Basics <a name="basics"></a>
---------------------------- ----------------------------
...@@ -55,7 +56,6 @@ know about: ...@@ -55,7 +56,6 @@ know about:
When building options for HTML tag we're often starting with defaults which we need to modify. In order to add or When building options for HTML tag we're often starting with defaults which we need to modify. In order to add or
remove CSS class you can use the following: remove CSS class you can use the following:
```php ```php
$options = ['class' => 'btn btn-default']; $options = ['class' => 'btn btn-default'];
...@@ -115,6 +115,7 @@ dealing with them. ...@@ -115,6 +115,7 @@ dealing with them.
> Note: consider using [[yii\widgets\ActiveForm|ActiveForm]] in case you deal with models and need validation. > Note: consider using [[yii\widgets\ActiveForm|ActiveForm]] in case you deal with models and need validation.
### Open and close a form ### Open and close a form
Form could be opened with [[yii\helpers\Html::beginForm()|beginForm()]] method like the following: Form could be opened with [[yii\helpers\Html::beginForm()|beginForm()]] method like the following:
...@@ -134,6 +135,7 @@ Closing form tag is simple: ...@@ -134,6 +135,7 @@ Closing form tag is simple:
<?= Html::endForm() ?> <?= Html::endForm() ?>
``` ```
### Buttons ### Buttons
In order to generate buttons you can use the following code: In order to generate buttons you can use the following code:
...@@ -154,7 +156,6 @@ There are two groups on input methods. The ones starting with `active` and calle ...@@ -154,7 +156,6 @@ There are two groups on input methods. The ones starting with `active` and calle
with it. Active inputs are taking data from model and attribute specified while in case of regular input data is specified with it. Active inputs are taking data from model and attribute specified while in case of regular input data is specified
directly. directly.
The most generic methods are: The most generic methods are:
```php ```php
...@@ -216,7 +217,6 @@ If not, use radio list: ...@@ -216,7 +217,6 @@ If not, use radio list:
### Labels and errors ### Labels and errors
Same as inputs there are two methods for generating form labels. Active that's taking data from the model and non-active Same as inputs there are two methods for generating form labels. Active that's taking data from the model and non-active
that accepts data directly: that accepts data directly:
...@@ -278,7 +278,6 @@ Styles and scripts ...@@ -278,7 +278,6 @@ Styles and scripts
There two methods to generate tags wrapping embedded styles and scripts: There two methods to generate tags wrapping embedded styles and scripts:
```php ```php
<?= Html::style('.danger { color: #f00; }') ?> <?= Html::style('.danger { color: #f00; }') ?>
...@@ -322,6 +321,7 @@ To link JavaScript file: ...@@ -322,6 +321,7 @@ To link JavaScript file:
Same as with CSS first argument specifies link to the file to be included. Options could be passed as the second argument. Same as with CSS first argument specifies link to the file to be included. Options could be passed as the second argument.
In options you can specify `condition` in the same way as in options for `cssFile`. In options you can specify `condition` in the same way as in options for `cssFile`.
Links Links
----- -----
...@@ -358,6 +358,7 @@ generates ...@@ -358,6 +358,7 @@ generates
Aside [aliases](concept-aliases.md) the first argument can accept routes, parameters and URLs. Same way as Aside [aliases](concept-aliases.md) the first argument can accept routes, parameters and URLs. Same way as
[Url::to()](helper-url.md) does. [Url::to()](helper-url.md) does.
Lists Lists
----- -----
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment