nettrinity
(Thanhvn Info)
April 15, 2011, 9:15pm
1
Here is the button() spec from class reference of CHtml:
http://www.yiiframework.com/doc/api/1.1/CHtml#button-detail
public static string button(string $label=‘button’, array $htmlOptions=array ( ))
But from this spec, I couldn’t know how to trigger an action using this. How do I assign an action in the form of controller/action format, or in the url format(e.g. www.yahoo.com )
Can you help? where I can find an example of CHtml::Buttion()? Is this the right question to ask? I think I got lost…
elbek
(Elbek Kamoliddinov)
April 15, 2011, 9:35pm
2
I think action to be assigned to form, not button
nettrinity
(Thanhvn Info)
April 15, 2011, 9:49pm
3
What do you mean? I don’t understand…
elbek
(Elbek Kamoliddinov)
April 15, 2011, 9:56pm
4
You can assign action to <form> tag
mentel
(Yii)
April 16, 2011, 1:11am
6
Try this:
<?php echo CHtml::Button('Go to Yahoo!', array('submit' => 'http://www.yahoo.com')); ?>
nettrinity
(Thanhvn Info)
April 16, 2011, 3:19pm
7
yeah, it’s what I need! thanks!
mentel
(Yii)
April 16, 2011, 3:36pm
8
Very nice!
Please don’t forget to vote
nettrinity
(Thanhvn Info)
April 16, 2011, 9:46pm
9
How do I vote? Rate Topic on top right corner?
jacmoe
(Jacob Moen)
April 16, 2011, 10:03pm
10
Go to post number 6 and click the green plus button there.
That way you reward him for providing you with a good answer - and encourage him to keep on helping out.
That’s the main idea anyway.
nettrinity
(Thanhvn Info)
April 16, 2011, 10:23pm
11
I see…Thanks for letting me know!