Hi there,
I recently upgraded to Yiistrap 1.2.0 for the sake of integrating bootstrap inputs into yii’s Form Builder via the new TbForm class.
The issue here is that I can’t get the extended input elements to work :
The following returns an ugly "include(dropDownList.php): failed to open stream: No such file or directory" at rendering time
class XRuleForm extends TbForm
{
...
public function __construct($option,$model,$parent)
{
$this->_xRuleClass = $xRuleClass = get_class($model);
$xClass = $xRuleClass::$labelField;
$config = array(
'title'=>t($option['Game_Option']),
'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
'elements'=>array(
"{$xRuleClass::$idField}"=>array(
'type'=>TbHtml::INPUT_TYPE_DROPDOWNLIST,
'items'=>$xClass::lookup(),
'visible'=>0, // defined during creation or save, doesn't need to be changed nor seen
),
'Rule_ID'=>array(
'type'=>TbHtml::INPUT_TYPE_DROPDOWNLIST,
'label'=>t($option['Game_Option_Desc']),
'items'=>GamesOptionsRules::model()->lookupRules($option),
),
),
);
parent::__construct($config,$model,$parent);
while the following old school form definition works :
<?php $form=$this->beginWidget('TbActiveForm', array(
'id'=>'clans-form',
'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
'enableAjaxValidation'=>false,
)); ?>
<?php echo $form->textFieldControlGroup($model,'Full_name',array('size'=>60,'maxlength'=>256)); ?>
<?php echo $form->textFieldControlGroup($model,'Short_name',array('size'=>60,'maxlength'=>256)); ?>
...
Please note that in the first example, when i change types to ‘dropdownlist’ it works.
I read the extension source code and it seems that it uses the standard cForm logic, except when a non core type is found.
In such case, it calls a controller->widget with our specific input type and that is when it crashes.
Hope someone can save me more time diving into the source code.