Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
6c80cba3
Commit
6c80cba3
authored
Dec 19, 2014
by
larnu
Committed by
Carsten Brandt
Dec 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update spanish helper-html.md
close #6578
parent
ee67d164
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
helper-html.md
docs/guide-es/helper-html.md
+6
-6
helper-html.md
docs/guide/helper-html.md
+5
-4
No files found.
docs/guide-es/helper-html.md
View file @
6c80cba3
...
...
@@ -162,10 +162,10 @@ especifica directamente.
Los métodos más genéricos son:
```
php
//
type, input name, input value, options
type, input name, input value, options
<?=
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
])
?>
```
...
...
@@ -282,13 +282,13 @@ Existen dos métodos para generar etiquetas que envuelvan estilos y scripts incr
```
php
<?=
Html
::
style
(
'.danger { color: #f00; }'
)
?>
//
Genera
Genera
<style>
.danger
{
color
:
#f00
;
}
</style>
<?=
Html
::
script
(
'alert("Hello!");'
,
[
'defer'
=>
true
]);
//
Genera
Genera
<
script
defer
>
alert
(
"Hello!"
);
</
script
>
```
...
...
@@ -298,7 +298,7 @@ Si se quiere enlazar un estilo externo desde un archivo CSS:
```
php
<?=
Html
::
cssFile
(
'@web/css/ie5.css'
,
[
'condition'
=>
'IE 5'
])
?>
//
genera
genera
<!--[if IE 5]>
<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:
```
php
<?=
Html
::
img
(
'@web/images/logo.png'
,
[
'alt'
=>
'My logo'
])
?>
//
genera
genera
<img
src=
"http://example.com/images/logo.png"
alt=
"My logo"
/>
```
...
...
docs/guide/helper-html.md
View file @
6c80cba3
...
...
@@ -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
with Html helper calls.
Basics <a name="basics"></a>
----------------------------
...
...
@@ -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
remove CSS class you can use the following:
```
php
$options
=
[
'class'
=>
'btn btn-default'
];
...
...
@@ -115,6 +115,7 @@ dealing with them.
> Note: consider using [[yii\widgets\ActiveForm|ActiveForm]] in case you deal with models and need validation.
### Open and close a form
Form could be opened with
[
[yii\helpers\Html::beginForm()|beginForm()
]
] method like the following:
...
...
@@ -134,6 +135,7 @@ Closing form tag is simple:
<?=
Html
::
endForm
()
?>
```
### Buttons
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
with it. Active inputs are taking data from model and attribute specified while in case of regular input data is specified
directly.
The most generic methods are:
```
php
...
...
@@ -216,7 +217,6 @@ If not, use radio list:
### 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
that accepts data directly:
...
...
@@ -278,7 +278,6 @@ Styles and scripts
There two methods to generate tags wrapping embedded styles and scripts:
```
php
<?=
Html
::
style
(
'.danger { color: #f00; }'
)
?>
...
...
@@ -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.
In options you can specify
`condition`
in the same way as in options for
`cssFile`
.
Links
-----
...
...
@@ -358,6 +358,7 @@ generates
Aside
[
aliases
](
concept-aliases.md
)
the first argument can accept routes, parameters and URLs. Same way as
[
Url::to()
](
helper-url.md
)
does.
Lists
-----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment