I am Trying to Convert Yii Jui timepicker extension into Yii2. But i am stacked at one method which is available in Yii but not in Yii2 called resolveNameID()
. I Found that method at CinputWidget.
But this method not found in yii2-jui/InputWidget.
I am able to convert below method in Yii2 partially but don't know where to put them. May be in yii2-jui/InputWidget.php
resolveNameID()
in Yii:
protected function resolveNameID()
{
if($this->name!==null)
$name=$this->name;
elseif(isset($this->htmlOptions['name']))
$name=$this->htmlOptions['name'];
elseif($this->hasModel())
$name=CHtml::activeName($this->model,$this->attribute);
else
throw new CException(Yii::t('yii','{class} must specify "model" and "attribute" or "name" property values.',array('{class}'=>get_class($this))));
if(($id=$this->getId(false))===null)
{
if(isset($this->htmlOptions['id']))
$id=$this->htmlOptions['id'];
else
$id=CHtml::getIdByName($name);
}
return array($name,$id);
}
I want to convert above method into Yii2 or any alternate method for resolveNameID()
in Yii2.
Thanks in Advance.