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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
a5ababe4
Commit
a5ababe4
authored
Mar 11, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished HtmlTest.
parent
03e212bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
21 deletions
+18
-21
ArrayHelper.php
framework/util/ArrayHelper.php
+2
-2
Html.php
framework/util/Html.php
+8
-7
Controller.php
framework/web/Controller.php
+0
-5
Pagination.php
framework/web/Pagination.php
+2
-2
ActiveForm.php
framework/widgets/ActiveForm.php
+6
-0
HtmlTest.php
tests/unit/framework/util/HtmlTest.php
+0
-0
todo.md
todo.md
+0
-5
No files found.
framework/util/ArrayHelper.php
View file @
a5ababe4
...
...
@@ -293,7 +293,7 @@ class ArrayHelper
* @return array the encoded data
* @see http://www.php.net/manual/en/function.htmlspecialchars.php
*/
public
static
function
htmlEncode
(
$data
,
$valuesOnly
=
fals
e
,
$charset
=
null
)
public
static
function
htmlEncode
(
$data
,
$valuesOnly
=
tru
e
,
$charset
=
null
)
{
if
(
$charset
===
null
)
{
$charset
=
Yii
::
$app
->
charset
;
...
...
@@ -322,7 +322,7 @@ class ArrayHelper
* @return array the decoded data
* @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php
*/
public
static
function
htmlDecode
(
$data
,
$valuesOnly
=
fals
e
)
public
static
function
htmlDecode
(
$data
,
$valuesOnly
=
tru
e
)
{
$d
=
array
();
foreach
(
$data
as
$key
=>
$value
)
{
...
...
framework/util/Html.php
View file @
a5ababe4
...
...
@@ -106,6 +106,7 @@ class Html
'checked'
,
'readonly'
,
'disabled'
,
'multiple'
,
'size'
,
'maxlength'
,
...
...
@@ -652,7 +653,7 @@ class Html
* except that the array keys represent the optgroup labels specified in $items.
* @return string the generated drop-down list tag
*/
public
static
function
dropDownList
(
$name
,
$items
,
$selection
=
null
,
$attributes
=
array
())
public
static
function
dropDownList
(
$name
,
$items
=
array
()
,
$selection
=
null
,
$attributes
=
array
())
{
$attributes
[
'name'
]
=
$name
;
$options
=
static
::
renderOptions
(
$items
,
$selection
,
$attributes
);
...
...
@@ -693,7 +694,7 @@ class Html
* mode, we can still obtain the posted unselect value.
* @return string the generated list box tag
*/
public
static
function
listBox
(
$name
,
$items
,
$selection
=
null
,
$attributes
=
array
())
public
static
function
listBox
(
$name
,
$items
=
array
()
,
$selection
=
null
,
$attributes
=
array
())
{
if
(
!
isset
(
$attributes
[
'size'
]))
{
$attributes
[
'size'
]
=
4
;
...
...
@@ -742,7 +743,7 @@ class Html
* value and the checked status of the checkbox input.
* @return string the generated checkbox list
*/
public
static
function
checkboxList
(
$name
,
$items
,
$selection
=
null
,
$options
=
array
())
public
static
function
checkboxList
(
$name
,
$items
=
array
()
,
$selection
=
null
,
$options
=
array
())
{
if
(
substr
(
$name
,
-
2
)
!==
'[]'
)
{
$name
.=
'[]'
;
...
...
@@ -800,7 +801,7 @@ class Html
* value and the checked status of the radio button input.
* @return string the generated radio button list
*/
public
static
function
radioList
(
$name
,
$items
,
$selection
=
null
,
$options
=
array
())
public
static
function
radioList
(
$name
,
$items
=
array
()
,
$selection
=
null
,
$options
=
array
())
{
$formatter
=
isset
(
$options
[
'item'
])
?
$options
[
'item'
]
:
null
;
$lines
=
array
();
...
...
@@ -850,7 +851,7 @@ class Html
{
$lines
=
array
();
if
(
isset
(
$attributes
[
'prompt'
]))
{
$prompt
=
str
tr
(
static
::
encode
(
$attributes
[
'prompt'
]),
' '
,
' '
);
$prompt
=
str
_replace
(
' '
,
' '
,
static
::
encode
(
$attributes
[
'prompt'
])
);
$lines
[]
=
static
::
tag
(
'option'
,
$prompt
,
array
(
'value'
=>
''
));
}
...
...
@@ -863,7 +864,7 @@ class Html
$groupAttrs
=
isset
(
$groups
[
$key
])
?
$groups
[
$key
]
:
array
();
$groupAttrs
[
'label'
]
=
$key
;
$attrs
=
array
(
'options'
=>
$options
,
'groups'
=>
$groups
);
$content
=
static
::
renderOptions
(
$
selection
,
$value
,
$attrs
);
$content
=
static
::
renderOptions
(
$
value
,
$selection
,
$attrs
);
$lines
[]
=
static
::
tag
(
'optgroup'
,
"
\n
"
.
$content
.
"
\n
"
,
$groupAttrs
);
}
else
{
$attrs
=
isset
(
$options
[
$key
])
?
$options
[
$key
]
:
array
();
...
...
@@ -871,7 +872,7 @@ class Html
$attrs
[
'selected'
]
=
$selection
!==
null
&&
(
!
is_array
(
$selection
)
&&
!
strcmp
(
$key
,
$selection
)
||
is_array
(
$selection
)
&&
in_array
(
$key
,
$selection
));
$lines
[]
=
static
::
tag
(
'option'
,
str
tr
(
static
::
encode
(
$value
),
' '
,
' '
),
$attrs
);
$lines
[]
=
static
::
tag
(
'option'
,
str
_replace
(
' '
,
' '
,
static
::
encode
(
$value
)
),
$attrs
);
}
}
...
...
framework/web/Controller.php
View file @
a5ababe4
...
...
@@ -16,8 +16,4 @@ namespace yii\web;
*/
class
Controller
extends
\yii\base\Controller
{
public
function
createUrl
(
$route
,
$params
=
array
())
{
}
}
\ No newline at end of file
framework/web/Pagination.php
View file @
a5ababe4
...
...
@@ -14,7 +14,7 @@ use Yii;
*
* When data needs to be rendered in multiple pages, Pagination can be used to
* represent information such as [[itemCount|total item count]], [[pageSize|page size]],
* [[page|current page]], etc. These information can be passed to [[yii\w
eb\w
idgets\Pager|pagers]]
* [[page|current page]], etc. These information can be passed to [[yii\widgets\Pager|pagers]]
* to render pagination buttons or links.
*
* The following example shows how to create a pagination object and feed it
...
...
@@ -47,7 +47,7 @@ use Yii;
* }
*
* // display pagination
* $this->widget('yii\w
eb\w
idgets\LinkPager', array(
* $this->widget('yii\widgets\LinkPager', array(
* 'pages' => $pages,
* ));
* ~~~
...
...
framework/widgets/ActiveForm.php
0 → 100644
View file @
a5ababe4
<?php
class
ActiveForm
{
}
tests/unit/framework/util/HtmlTest.php
View file @
a5ababe4
This diff is collapsed.
Click to expand it.
todo.md
View file @
a5ababe4
...
...
@@ -32,8 +32,6 @@ memo
*
module
-
Module should be able to define its own configuration including routes. Application should be able to overwrite it.
*
application
*
security
-
backport 1.1 changes
-
built-in console commands
+
api doc builder
*
support for markdown syntax
...
...
@@ -46,7 +44,6 @@ memo
*
parsing??
*
make dates/date patterns uniform application-wide including JUI, formats etc.
-
helpers
*
array
*
image
*
string
*
file
...
...
@@ -59,8 +56,6 @@ memo
*
move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic.
*
i18n variant of templates
*
allow to generate module-specific CRUD
-
markup and HTML helpers
*
use HTML5 instead of XHTML
-
assets
*
ability to manage scripts order (store these in a vector?)
*
http://ryanbigg.com/guides/asset_pipeline.html, http://guides.rubyonrails.org/asset_pipeline.html, use content hash instead of mtime + directory hash.
...
...
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