php - Set model variable from activeTextField with Yii -


I have difficulty installing a variable in my model from an activeTestField in Yii Here's my view:

  echo chtml :: activetextfold ($ model, 'text_field', array ('id' => 'test')); Echo CHtml :: submitButton ('query');  

My model:

  class query farm extends CFormModel {public $ text_field; }  

My Controller:

  Public function actionQuery () {$ model = new queryform; Revert $ Model- & gt; Text_field; }  

I am searching for answers on Google but I have difficulty in getting started with the initial questions like it Thanks!

Instead you should do

  if (isset ($ _POST ['textField']) {$ Model-> Attributes = $ _POST ['textField']; Model Model- & gt; Text_field;}  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -