Eso es porque quizas estas intentando mostrar una VIEW que no pertenece al controlador donde estan los TABS. Si ese es el caso, te recomiendo utilices el siguiente ALIAS:
// lo siguiente quiere decir:
// render la view que se llama formulariouser y que
// se encuentra en PROTECTED/VIEWS/USER/
renderPartial('application.views.user.formulariouser');
'tabs'=>array(
'User'=>'Probar si funciona',
'Usuarios'=>'Probar si funciona',
//panel 3 contains the content rendered by a partial view
'AjaxTab'=>array('ajax'=>$this->createUrl('/AjaxModule/ajax/reqTest01')),
),
//additional javasscript options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
));
?>
y el me mustra los tabs en el Home…aunque no se si lo hice de forma correcta
El camino es equivocado, está buscando dentro de la carpeta de usuario
Intente lo siguiente
$this->widget('zii.widgets.jui.CJuiTabs', array(
'tabs'=>array(
//note that the // will make it point to the application.views folder
'User'=>$this->renderpartial('//user/_form.php',array('model'=>$model),true),
'Usuarios'=>$this->renderpartial('//user',array(),true),
),
//additional javasscript options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
));
So, you pass variables to the views in the following way
$this->render('viewToRender',array('variable1'=>$value1,'variable2'=>$value));
//or renderPartial, the first parameter is the view file and the second is an array with all its variables
and to use it in the view file you rendered do something like the following
echo $variable1;
in your case CModel::getErrors() is probably an error genarated by CActiveorm widge, when you use its method
echo $form->errorSummary($model);
so I presume that the $model variable is not set in your view, to do so, you must define it in the controller, something like the following:
I’m sorry, but the truth is that I’m super new to this and am doing my best to learn the truth but I am very clear about your explanation, if you do not mind can you tell me the name of the files I need to modify or need something more specific in my code so that I could help.
Ptt: My English is not that great but seriously do not know how I appreciate your help.
Después de que leí tu post un par de veces me entiende cuál es el problema.
Quieres acceder al Formulario de otro controlador. ¿correcto?
Si es así, usted necesita un ajaxTab, y usted puede hacerlo de esta manera:
'AjaxTab' => array ('ajax' => $this->createUrl('/user/create')),// si desea crear un nuevo usuario
/ / o
'AjaxTab' => array ('ajax' => $this->createUrl('/user/ update', array ('id' => 1 ))),// si desea actualizar un usuario existente, es esto caso el usuario numero 1
por lo que el código completo sería algo así como:
también tiene que renderizar una view diferente en el controlador, cambia la view existente para ‘_abas’ y crear un archivo _abas en views / site / _abas.php
something like
class SiteController extends Controller{
public function actionIndex(){
//your code
//cambia el render index por _abas
$this->render('_abas',array('....'));//aki
}
}
Esto es para las personas que estan aprendiendo Yii como yo espero que les sirva como me sirvio a mi.
"Para ello, cambia el archivo controlador que se encuentra probablemente en
protected/components/Controller.php
cambia el método de inicio si es que existe, y si no crea uno
class Controller extends CController{
function init(){//crear esto se no existir
parent::init();
if(Yii::app()->getRequest()->isAjaxRequest){ //if the page was loaded by ajax (ajaxTab)
$this->layout=false;//disable the layout
}
}
}"
Lo siento se me paso la parte del codigo del CJuiTabs
En la views/site/index agregamos el codigo de CJUITabs:
$this->widget(‘zii.widgets.jui.CJuiTabs’,array(
'tabs'=>array(
'Tabla1'=>array('ajax'=>array('/user'),'id'=>$model->id),
'Tabla2'=>array('ajax'=>array('/user/create'),'id'=>$model->id),
'Usuarios'=>'contenido de la tabla.',
//panel 3 contains the content rendered by a partial view
'AjaxTab'=>array('ajax'=>$this->createUrl('/AjaxModule/ajax/reqTest01')),
),
//additional javascrip options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
));
Les adjunto una imagen de lo que yo queria hacer en las CJuiTabs.
Ptt: Todavia estoy investigando como agregar un CJuiAccodion en el CJuitabs apenas sepa como subo el codigo.