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

225
Views
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 answers
Answer question

0

Found It :P

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

in crontroller

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!