Yii Framework Forum: Absolute Path For Form Actions - Yii Framework Forum

Jump to content

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

Absolute Path For Form Actions Rate Topic: -----

#1 User is offline   shahdoost 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 30-March 12

Posted 10 December 2012 - 07:12 AM

Hi

Does anybody know the best way to change form action urls to absolute urls,

I'm trying to create mirrors from my original website, and in order to do that I need all of my form actions to be absolute, but I haven't found a good way (which is not by changing my framework source code) to change form action urls

I would be thankful if anybody could help me
0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 511
  • Joined: 08-August 09

Posted 11 December 2012 - 05:29 AM

You may use createAbsoluteUrl() to form your urls.
If you use CHtml::beginForm(), then pass your url as the first parameter.
If you use CActiveForm, you may pass 'action' parameter to it with you absolute url.


If you need more common solution - extend CHtml or CActiveForm class to use (build) the action you need and use your own class to build form tag.
1

#3 User is offline   shahdoost 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 30-March 12

Posted 11 December 2012 - 06:07 AM

Thanks yugene,

I think I've gotta go with the second solution
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