Yii Framework Forum: Multipe Forms To Multiple Actions/views - Yii Framework Forum

Jump to content

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

Multipe Forms To Multiple Actions/views Rate Topic: -----

#1 User is offline   coolPhp 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 15-December 10

Posted 03 December 2012 - 11:24 AM

Hi All.

Is there a way where I can have mutlipe forms on a page where each submit will call a different action in the same controller eg

view review
form review calls review/review
form submit calls review/submit
form view calls review/view
end view

can this be done?
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,601
  • Joined: 04-March 10
  • Location:UK

Posted 03 December 2012 - 04:23 PM

Yes, just specify the route in the beginForm() call.

<?= CHtml::beginForm('/review/review'); ?>
...
<?= CHtml::endForm(); ?>

<?= CHtml::beginForm('/review/submit'); ?>
...
<?= CHtml::endForm(); ?>

0

#3 User is offline   coolPhp 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 15-December 10

Posted 04 December 2012 - 10:45 AM

View PostKeith, on 03 December 2012 - 04:23 PM, said:

Yes, just specify the route in the beginForm() call.

<?= CHtml::beginForm('/review/review'); ?>
...
<?= CHtml::endForm(); ?>

<?= CHtml::beginForm('/review/submit'); ?>
...
<?= CHtml::endForm(); ?>




Thanks this will help me alot
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