Commit a5ababe4 by Qiang Xue

Finished HtmlTest.

parent 03e212bc
...@@ -293,7 +293,7 @@ class ArrayHelper ...@@ -293,7 +293,7 @@ class ArrayHelper
* @return array the encoded data * @return array the encoded data
* @see http://www.php.net/manual/en/function.htmlspecialchars.php * @see http://www.php.net/manual/en/function.htmlspecialchars.php
*/ */
public static function htmlEncode($data, $valuesOnly = false, $charset = null) public static function htmlEncode($data, $valuesOnly = true, $charset = null)
{ {
if ($charset === null) { if ($charset === null) {
$charset = Yii::$app->charset; $charset = Yii::$app->charset;
...@@ -322,7 +322,7 @@ class ArrayHelper ...@@ -322,7 +322,7 @@ class ArrayHelper
* @return array the decoded data * @return array the decoded data
* @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php * @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php
*/ */
public static function htmlDecode($data, $valuesOnly = false) public static function htmlDecode($data, $valuesOnly = true)
{ {
$d = array(); $d = array();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
......
...@@ -106,6 +106,7 @@ class Html ...@@ -106,6 +106,7 @@ class Html
'checked', 'checked',
'readonly', 'readonly',
'disabled', 'disabled',
'multiple',
'size', 'size',
'maxlength', 'maxlength',
...@@ -652,7 +653,7 @@ class Html ...@@ -652,7 +653,7 @@ class Html
* except that the array keys represent the optgroup labels specified in $items. * except that the array keys represent the optgroup labels specified in $items.
* @return string the generated drop-down list tag * @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; $attributes['name'] = $name;
$options = static::renderOptions($items, $selection, $attributes); $options = static::renderOptions($items, $selection, $attributes);
...@@ -693,7 +694,7 @@ class Html ...@@ -693,7 +694,7 @@ class Html
* mode, we can still obtain the posted unselect value. * mode, we can still obtain the posted unselect value.
* @return string the generated list box tag * @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'])) { if (!isset($attributes['size'])) {
$attributes['size'] = 4; $attributes['size'] = 4;
...@@ -742,7 +743,7 @@ class Html ...@@ -742,7 +743,7 @@ class Html
* value and the checked status of the checkbox input. * value and the checked status of the checkbox input.
* @return string the generated checkbox list * @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) !== '[]') { if (substr($name, -2) !== '[]') {
$name .= '[]'; $name .= '[]';
...@@ -800,7 +801,7 @@ class Html ...@@ -800,7 +801,7 @@ class Html
* value and the checked status of the radio button input. * value and the checked status of the radio button input.
* @return string the generated radio button list * @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; $formatter = isset($options['item']) ? $options['item'] : null;
$lines = array(); $lines = array();
...@@ -850,7 +851,7 @@ class Html ...@@ -850,7 +851,7 @@ class Html
{ {
$lines = array(); $lines = array();
if (isset($attributes['prompt'])) { if (isset($attributes['prompt'])) {
$prompt = strtr(static::encode($attributes['prompt']), ' ', ' '); $prompt = str_replace(' ', ' ', static::encode($attributes['prompt']));
$lines[] = static::tag('option', $prompt, array('value' => '')); $lines[] = static::tag('option', $prompt, array('value' => ''));
} }
...@@ -863,7 +864,7 @@ class Html ...@@ -863,7 +864,7 @@ class Html
$groupAttrs = isset($groups[$key]) ? $groups[$key] : array(); $groupAttrs = isset($groups[$key]) ? $groups[$key] : array();
$groupAttrs['label'] = $key; $groupAttrs['label'] = $key;
$attrs = array('options' => $options, 'groups' => $groups); $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); $lines[] = static::tag('optgroup', "\n" . $content . "\n", $groupAttrs);
} else { } else {
$attrs = isset($options[$key]) ? $options[$key] : array(); $attrs = isset($options[$key]) ? $options[$key] : array();
...@@ -871,7 +872,7 @@ class Html ...@@ -871,7 +872,7 @@ class Html
$attrs['selected'] = $selection !== null && $attrs['selected'] = $selection !== null &&
(!is_array($selection) && !strcmp($key, $selection) (!is_array($selection) && !strcmp($key, $selection)
|| is_array($selection) && in_array($key, $selection)); || is_array($selection) && in_array($key, $selection));
$lines[] = static::tag('option', strtr(static::encode($value), ' ', ' '), $attrs); $lines[] = static::tag('option', str_replace(' ', ' ', static::encode($value)), $attrs);
} }
} }
......
...@@ -16,8 +16,4 @@ namespace yii\web; ...@@ -16,8 +16,4 @@ namespace yii\web;
*/ */
class Controller extends \yii\base\Controller class Controller extends \yii\base\Controller
{ {
public function createUrl($route, $params = array())
{
}
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ use Yii; ...@@ -14,7 +14,7 @@ use Yii;
* *
* When data needs to be rendered in multiple pages, Pagination can be used to * 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]], * represent information such as [[itemCount|total item count]], [[pageSize|page size]],
* [[page|current page]], etc. These information can be passed to [[yii\web\widgets\Pager|pagers]] * [[page|current page]], etc. These information can be passed to [[yii\widgets\Pager|pagers]]
* to render pagination buttons or links. * to render pagination buttons or links.
* *
* The following example shows how to create a pagination object and feed it * The following example shows how to create a pagination object and feed it
...@@ -47,7 +47,7 @@ use Yii; ...@@ -47,7 +47,7 @@ use Yii;
* } * }
* *
* // display pagination * // display pagination
* $this->widget('yii\web\widgets\LinkPager', array( * $this->widget('yii\widgets\LinkPager', array(
* 'pages' => $pages, * 'pages' => $pages,
* )); * ));
* ~~~ * ~~~
......
<?php
class ActiveForm
{
}
...@@ -32,8 +32,6 @@ memo ...@@ -32,8 +32,6 @@ memo
* module * module
- Module should be able to define its own configuration including routes. Application should be able to overwrite it. - Module should be able to define its own configuration including routes. Application should be able to overwrite it.
* application * application
* security
- backport 1.1 changes
- built-in console commands - built-in console commands
+ api doc builder + api doc builder
* support for markdown syntax * support for markdown syntax
...@@ -46,7 +44,6 @@ memo ...@@ -46,7 +44,6 @@ memo
* parsing?? * parsing??
* make dates/date patterns uniform application-wide including JUI, formats etc. * make dates/date patterns uniform application-wide including JUI, formats etc.
- helpers - helpers
* array
* image * image
* string * string
* file * file
...@@ -59,8 +56,6 @@ memo ...@@ -59,8 +56,6 @@ memo
* move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic. * move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic.
* i18n variant of templates * i18n variant of templates
* allow to generate module-specific CRUD * allow to generate module-specific CRUD
- markup and HTML helpers
* use HTML5 instead of XHTML
- assets - assets
* ability to manage scripts order (store these in a vector?) * 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. * http://ryanbigg.com/guides/asset_pipeline.html, http://guides.rubyonrails.org/asset_pipeline.html, use content hash instead of mtime + directory hash.
......
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