Yii Framework Forum: Chapter 6 - Agile Web Application Development With Yii1.1 And Php5 Issue - Yii Framework Forum

Jump to content

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

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

#1 User is offline   amsandun 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 06-November 12
  • Location:Sri Lanka

Posted 09 December 2012 - 06:02 AM

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
0

#2 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,317
  • Joined: 21-February 11
  • Location:Greece

Posted 12 December 2012 - 10:37 AM

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)) :)
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
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