Controller cannot find view

Hello,

I am constanly getting this message.

USERSController cannot find the requested view "list".

when i try to access this url

http://localhost/spinvest/index.php/USERS/list

Now, there is a directory called USERS and it has a file called list.php.

Alternately if i try to open the url like this

http://localhost/spinvest/index.php/USERS/lista

then it says

The system is unable to find the requested action "lista".

So i guess, I am missing something very small. Can somebody please help me ?

thanks

Arvind

I put in some debugging code… and i found this

public function actionList()

{


	$criteria=new CDbCriteria;





	$pages=new CPagination(USERS::model()->count($criteria));


	$pages->pageSize=self::PAGE_SIZE;


	$pages->applyLimit($criteria);





	$models=USERS::model()->findAll($criteria);

echo "i reached here";

exit;

	$this->render('list',array(


		'models'=>$models,


		'pages'=>$pages,


	));


}

It prints out "I reached here".

and then it does not like the render part. Keeps complaining that the view list does not exist.

i am sure, its something small that i am missing.

thanks

Arvind

I’m having the same problem with Yii 1.1.1. I’m following the instructions from the tutorial (http://www.yiiframework.com/doc/guide/form.action) but seem to be missing something.

I’m trying to 0create a registration (signup) form.

My model is protected/models/SignupForm.php:




<?


  class SignupForm extends CFormModel

  {

    public $username;

    public $password_one;

    public $password_two;

    public $password_hint;

    public $msisdn;

    public $email;

    public $secret_question;

    public $secret_answer;

    public $account_type;

    

    public $xml_response;

    

    public function rules()

    {

      return array(

        array('username,password_one,password_two,password_hint,msisdn,email,secret_question,secret_answer,account_type', 'required'),

        array('password_one, password_two', 'email'),

      );

    }

       

  }

?>



My controller is protected/controllers/TestHarnessController.php:




<?

  class TestHarnessController extends Controller

  {

    public function actionSignup()

    {

      $model = new SignupForm();

      if (isset($_POST['SignupForm']))

      {

        // Collect user input data...

        $model->attributes = $_POST['SignupForm'];

        

        // Validate user input and redirect to previous page if validated...

        if ($model->validate())

          $this->redirect(Yii::app()->user->returnUrl);

      }

      

      // Display the Signup form...

      $this->render('signup', array('model' => $model));

    }    

  }

?>



The view I want to display is protected/views/testharness/signup.php:




<?php

$this->pageTitle=Yii::app()->name . ' - Sign Up Test';

$this->breadcrumbs=array(

	'Signup Test',

);

?>


<h1>Sign-up</h1>


<p>Enter valid credentials to create a new account:</p>


<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'signup-form',

	'enableAjaxValidation'=>true,

)); ?>




<?php $this->endWidget(); ?>

</div><!-- form -->



Any help would be really appreciated…

I found the problem - the first letter of the directory created in protected/views cannot start with a capital letter (on Linux systems anyway).

I had the following directory:

protected/views/TestHarness/

This resulted in the "Controller cannot find view" error. When I changed the directory name to:

protected/views/testHarness/

then everything works as expected.

Thanks a lot Scott Deagan!

I had the same problem.

The directory was:

protected/view/PCombustiveis

After change to protected/view/pCombustiveis its work!

Many thanks!

Please, excuse my poor english.