title: Convert yii resolveNameID() method into Yii2
body: <p>I am Trying to Convert <a href="http://www.yiiframework.com/extension/jtimepicker/" rel="nofollow noreferrer">Yii  Jui timepicker extension</a> into Yii2. But i am stacked at one method which is available in Yii but not in Yii2 called <code>resolveNameID()</code>. I Found that method at <a href="http://www.yiiframework.com/doc/api/1.1/CInputWidget#resolveNameID-detail" rel="nofollow noreferrer">CinputWidget</a>.</p>
  <p>But this method not found in <a href="https://github.com/yiisoft/yii2-jui" rel="nofollow noreferrer">yii2-jui/InputWidget</a>.</p>
  <p>I am able to convert below method in Yii2 partially but don't know where to put them. May be in <code>yii2-jui/InputWidget.php</code></p>
  <p><code>resolveNameID()</code> in Yii:</p>
  <pre><code>protected function resolveNameID()
  {
     if($this-&gt;name!==null)
        $name=$this-&gt;name;
     elseif(isset($this-&gt;htmlOptions['name']))
        $name=$this-&gt;htmlOptions['name'];
     elseif($this-&gt;hasModel())
        $name=CHtml::activeName($this-&gt;model,$this-&gt;attribute);
     else
        throw new CException(Yii::t('yii','{class} must specify &quot;model&quot; and &quot;attribute&quot; or &quot;name&quot; property values.',array('{class}'=&gt;get_class($this))));
  
     if(($id=$this-&gt;getId(false))===null)
     {
        if(isset($this-&gt;htmlOptions['id']))
            $id=$this-&gt;htmlOptions['id'];
        else
            $id=CHtml::getIdByName($name);
    }
  
      return array($name,$id);
    }
  </code></pre>
  <p>I want to convert above method into Yii2 or any alternate method for <code>resolveNameID()</code> in Yii2.</p>
  <p>Thanks in Advance.</p>