Browse Source

Model::formName() correct PHP 5.3 code

tags/2.0.0-beta
Alexander Kochetov 12 years ago
parent
commit
a788f505fb
  1. 5
      framework/yii/base/Model.php

5
framework/yii/base/Model.php

@ -186,9 +186,8 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess, Jsona
*/ */
public function formName() public function formName()
{ {
$class = get_class($this); $reflector = new \ReflectionClass($this);
$pos = strrpos($class, '\\'); return $reflector->getShortName();
return $pos === false ? $class : substr($class, $pos + 1);
} }
/** /**

Loading…
Cancel
Save