Commit a788f505 by Alexander Kochetov

Model::formName() correct PHP 5.3 code

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