Chapter 6 - Agile Web Application Development With Yii1.1 And Php5 Issue

Hello,

in Altering the ProjectController in chap 06 for issue listing on the project view page, the yii version used in the book is 1.1.2. But I followed the book with yii 1.1.12

I see that the controller methods are different from older versions. So the code in the book does not work with my version.

older version does not use a variable called $id as a parameter for the controller methods and functions.

But in yii 1.1.12 version there is a $id variable.

did anyone else come across this issue. Is there any way of getting this right ?

really appreciate any helpful replies.

thanks.

sandun

Hi amsandun

In the old version of Yii the methods “actionSomething” Didn’t take parameters.

In new Yii version This parameters come from GET php method (in most cases) through Yii core mechanism.

In older version you have to take from yourself this parametesrs as


if ($isset($_GET['id'])) { $id=$_GET['id'] }

 

//now you can use $id

In new version you can use $id directly (if method set as actionSome($id)) :)