yiisoft/yii2 — pull request #173 by petrabarus (2013-05-08 01:23:56+00:00)
Title: Add static method to return the class name in Object class

One of great hassle when I develop using Yii1.1 is that I have to write the name of the class manually for methods like `beginWidget` etc. And it's hard to use it using IDE like Netbeans.

I'm proposing to add `get_called_class` wrapper in Object class
http://php.net/manual/en/function.get-called-class.php

something like this

```php
///Object.php
/**
* Returns the class name.
* @return string the name of the class.
*/
public static function getClassName()
{
return get_called_class();
}
```

that way I can easily use this in the view, or somewhere else.

```php
/* @var $this yii\base\View */
$this->widget(app\components\TestWidget::getClassName());
```

and the IDE can easily recognize the TestWidget class, and I can easily click on it to go to the file.