Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

229
Visualizações
FileNameController cannot find the requested view "create" in Yii 1

I have upload a new form in an existing webapp which is live (Linux server). But I am not able to set the route properly and get error.

Files : 1. view/newform/(create,index,view,_view,_form).php

  1. controllers/NewFormController.php

  2. models/NewForm.php

main.php :

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

   **********************************

Link I use to access the wbepage online :

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 )

I can view it properly on localhost(windows) => localhost/public_html/index.php?r=newform/create

Questions : What link should I use to view it online ? How to get correct Route to the form I created ?

Edited : I can view the index page after adding the path (/newform/index) in actionIndex(). controller

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

Here is the create function :
When I use this the error I get : cannot find the requested view "_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 Respostas
Responde à pergunta

0

Found It :P

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

in crontroller

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda