Hi all…ime troubling with the extension nestedsetbehavior
i installed it and i have followed all the instructions that ive found…
my problem its that i dont know how to add code in actionCreate and actionUpadte inside my model
i found this code
if(isset($_POST['Category']))
{
echo $_POST['Category']['id'] . '<br />';
echo $_POST['Category']['title'] . '<br />';
$root = Category::model()->findByPk(1);
$element=new Category;
$element->title=$_POST['Category']['title'];
$element->appendTo($root);
}
but i get this notice
Undefined index: title
and i cant go ahead…
in my _form.php file i’ve this code
<div class="row">
<?php
$dataArr = array();
$combo_populate = Category::model()->findAll();
foreach($combo_populate as $comboVal)
{
array_push($dataArr, $comboVal['title']);
}
echo CHtml::label('Seleziona:','title');
$this->widget('application.components.widgets.yii-combobox.EJuiComboBox', array(
'model' => Category::model(),
'attribute' => 'id',
// 'attribute' => 'title',
'data' => $dataArr,
'options' => array(
'onSelect' => '',
'onChange' => 'alert("changed value : " + $(this).val());',
'allowText' => true,
),
));
?>
</div>
can anyone help me please… ? thank you very much to all…