I have two tables in my database, TableA and TableB. I used the Gii tool (which by the way is awesome) to create controllers, models and CRUD forms for the tables.
My problem is when i try to render TableA’s create form inside a CJuiDialog modal inside TableB’s view. The idea is to be able to create new entries of TableA without leaving the create form of TableB.
The code from _form.php of TableB that i added at the top is:
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id'=>'tableA')); // and some options too
$this->renderPartial('/TableA/create');
$this->endWidget('zii.widgets.jui.CJuiDialog');
This does not work and i get an error about ‘Undefined variable: model’ inside TableA/create.php.
I assume this is due to the $model variable inside the controller of TableA is not in scope. But how can i fix this?