Commit a5ababe4 by Qiang Xue

Finished HtmlTest.

parent 03e212bc
......@@ -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 = false, $charset = null)
public static function htmlEncode($data, $valuesOnly = true, $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 = false)
public static function htmlDecode($data, $valuesOnly = true)
{
$d = array();
foreach ($data as $key => $value) {
......
......@@ -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 = strtr(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', strtr(static::encode($value), ' ', ' '), $attrs);
$lines[] = static::tag('option', str_replace(' ', ' ', static::encode($value)), $attrs);
}
}
......
......@@ -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
......@@ -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\web\widgets\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\web\widgets\LinkPager', array(
* $this->widget('yii\widgets\LinkPager', array(
* 'pages' => $pages,
* ));
* ~~~
......
<?php
class ActiveForm
{
}
......@@ -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.
......
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