Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
FileNameController no puede encontrar la vista solicitada "crear" en Yii 1

Cargué un nuevo formulario en una aplicación web existente que está activa (servidor Linux). Pero no puedo configurar la ruta correctamente y obtengo un error.

Archivos: 1. ver/nuevoformulario/(crear,índice,ver,_ver,_formulario).php

  1. controladores/NewFormController.php

  2. modelos/NewForm.php

principal.php:

 'urlManager' => array( 'showScriptName' => false, 'urlFormat' => 'path', 'rules' => array( '/' => 'site/index', 'newform' => 'newform/create', /*This rule is for new form */ **********************************

Enlace que uso para acceder a la página wbe en línea:

 websitename.com/newform/create or create.php (I get 404 not found) websitename.com/NewForm/create or create.php (NewFormController cannot find the requested view "create" error )

Puedo verlo correctamente en localhost (windows) => localhost/public_html/index.php?r=newform/create

Preguntas: ¿Qué enlace debo usar para verlo en línea? ¿Cómo obtener la ruta correcta al formulario que creé?

Editado: puedo ver la página de índice después de agregar la ruta (/newform/index) en actionIndex(). controlador

 public function actionIndex() { $dataProvider=new CActiveDataProvider('NewForm'); $this->render('/newform/index',array( 'dataProvider'=>$dataProvider, )); }

Aquí está la función de creación:
Cuando uso esto, aparece el error: no se puede encontrar la vista solicitada "_form"

 public function actionCreate() { $model=new NewForm; // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if(isset($_POST['NewForm'])) { $model->attributes=$_POST['NewForm']; if($model->save()) $this->redirect(array('view','id'=>$model->id)); } $this->render('/newform/create',array( 'model'=>$model, )); }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

lo encontre :P

 $this->render('/newform/_form',array( 'model'=>$model, ));

en controlador

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!