Yii Framework Forum: [solved] Crud controllers: Cannot find Controller class after upgrade - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[solved] Crud controllers: Cannot find Controller class after upgrade Extending Controller instead of CController Rate Topic: -----

#1 User is offline   Alex Muir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 25-April 09

Posted 19 January 2010 - 05:36 AM

I've just upgraded a project from 1.1b to the current build of 1.1. Now when I use the yiic crud command to generate code and then view it in a browser, I'm getting two errors:

Firstly, the new controller extends Controller, and not CController as it has previously. PHP can't find Controller so I get an undefined class error. Then when I change Controller to CController I get another error from the view:

Property "VacancyController.breadcrumbs" is not defined.


This is caused by this code in the crud generated view:
<?php
$this->breadcrumbs=array(
	'Jobs Vacancys',
);
?>


Obviously I've cocked something up in the upgrade. Any thoughts?
My sites: The Big Eat and The Big Space
0

#2 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 19 January 2010 - 08:01 AM

You should read the changelog before updating. With that said, now you should probably generate a blank web app and copy the the files like protected/components/Controller.php and any other if necessary, have your controllers that CController extend Controller. There were other changes made for 1.1 such as the alias for the table in a relation etc...
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#3 User is offline   Alex Muir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 25-April 09

Posted 19 January 2010 - 08:50 AM

Nice one, thanks a lot. I did read the upgrade bits in both the Definitive Guide and in the download area but nothing was mentioned about this. It's also worth noting that all the CSS styles have changed, so any newly generated CRUD views are going to be incompatible with the old CSS files.
My sites: The Big Eat and The Big Space
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users