Yii Framework Forum: code for Button - Yii Framework Forum

Jump to content

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

code for Button

#1 User is offline   PHPYII 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 02-July 10

Posted 02 July 2010 - 12:37 AM

I m new in Yii . I hve given a button in post view page now I want to write code for insertion in some other table.actually i m doing for job portals and in post view page button is for appliyng the perticular job and I want to insert the userid,useremail,uername and postjob id and postjob title.pls help me
0

#2 User is offline   shailesh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 14-May 11
  • Location:Ahmedabad(India)

Posted 02 November 2011 - 01:26 AM

<?php

$form=$this->beginWidget('CActiveForm', array('id'=>'form','enableClientValidation'=>true,
'clientOptions'=>array('validateOnSubmit'=>true,),
));

?>

...
....
Add Required Controls here and Put inside

$form->


..
<?php
$this->widget('zii.widgets.jui.CJuiButton', array('buttonType'=>'submit','name'=>'btnSubmit',
'value'=>'Submit',
'caption'=>$model->isNewRecord ? 'Create' : 'Save',
)

);
?>


now in Controller u can Handle event Action
0

#3 User is offline   elenalee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-November 11

Posted 11 November 2011 - 01:29 PM

thanks for providing code for the buttons
===============
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