Commit e3ca5a81 by Qiang Xue

Reverted/fixed some incorrect changes.

parent 85926014
...@@ -268,6 +268,6 @@ class ViewRenderer extends BaseViewRenderer ...@@ -268,6 +268,6 @@ class ViewRenderer extends BaseViewRenderer
public function aliasHandler($type, $name, &$content, &$modified, Smarty $smarty) public function aliasHandler($type, $name, &$content, &$modified, Smarty $smarty)
{ {
$file = Yii::getAlias($name); $file = Yii::getAlias($name);
return $file !== false && is_file($file) ? $file : false; return is_file($file) ? $file : false;
} }
} }
...@@ -63,14 +63,15 @@ trait ArrayableTrait ...@@ -63,14 +63,15 @@ trait ArrayableTrait
* information. For example, depending on the privilege of the current application user, * information. For example, depending on the privilege of the current application user,
* you may return different sets of visible fields or filter out some fields. * you may return different sets of visible fields or filter out some fields.
* *
* The default implementation of this method returns the public object member variables. * The default implementation of this method returns the public object member variables indexed by themselves.
* *
* @return array the list of field names or field definitions. * @return array the list of field names or field definitions.
* @see toArray() * @see toArray()
*/ */
public function fields() public function fields()
{ {
return array_keys(Yii::getObjectVars($this)); $fields = array_keys(Yii::getObjectVars($this));
return array_combine($fields, $fields);
} }
/** /**
......
...@@ -329,12 +329,12 @@ class HelpController extends Controller ...@@ -329,12 +329,12 @@ class HelpController extends Controller
// show as integer to avoid confusion // show as integer to avoid confusion
$defaultValue = (int) $defaultValue; $defaultValue = (int) $defaultValue;
} }
if ($type === 'boolean') { if (strncmp($type, 'bool', 4) === 0) {
$type = 'boolean, 0 or 1'; $type = 'boolean, 0 or 1';
} }
$doc = "$type (defaults to " . var_export($defaultValue, true) . ")"; $doc = "$type (defaults to " . var_export($defaultValue, true) . ")";
} elseif (trim($type) !== '') { } elseif (trim($type) !== '') {
if ($type === 'boolean') { if (strncmp($type, 'bool', 4) === 0) {
$type = 'boolean, 0 or 1'; $type = 'boolean, 0 or 1';
} }
$doc = $type; $doc = $type;
......
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