Yii Framework Forum: check $_GET['pk'] should be append in loadModel()? - Yii Framework Forum

Jump to content

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

check $_GET['pk'] should be append in loadModel()? see page. 204

#1 User is offline   Mikewolf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 04-January 12

Posted 07 February 2012 - 04:34 PM

I am trying the creating custom grid columns, and found maybe man should append two line like this:

if(isset($_GET['pk'])) 
    $this->_model=Customer::model()->findbyPk($_GET['pk']);


in controller loadModel() funciton.

because in function renderDataCellContent, there is one line like this:
$this->callbackUrl['pk'] = $data->primaryKey;


that means the ajax call with a parameter named pk, which should be checked and used in loadModel() function. otherwise there is 404 error, when man try to test the code in the book.
Newbee of Yii
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