Yii framework classes are prefixed with letter C. Version 2.0 will use namespace and will remove C letter?
Yii framework classes are prefixed with letter C. Version 2.0 will use namespace and will remove C letter?
Yes
I was wondering if there will be a new best-practice way to extend classes with namespaces.
As an example, if I want to extend CHtml or \Yii\Html maybe.
class \MyNamespace\Html extends \Yii\Html {
function myFunc(){
...
}
}
If my namespace takes precedence I could use Html to access both objects.
Html::tag()
or
Html::myFunc()
Would this be a recommended way?
Yes.
Or you could alias the classname to have a more obvious naming:
<?php
namespace My\Namespace;
use \Yii\Web\HTML as YHTML;
use My\Namespace\HTML as EHTML;
class HTML extends YHTML{
}
echo EHTML::tag();