YII picture button CHtml::imageButton_PHP tutorial

WBOY
Release: 2016-07-13 17:52:53
Original
850 people have browsed it

CHtml::imageButton method can use an image as a button, but the submission method is not post,

It may also be GET, I haven’t tried GET.

Write this in view:

if(isset($_GET['id']))
{
echo CHtml::imageButton(Yii::app()->baseUrl.'/images/button1.png',array('submit' => 'action1?id='.$_GET['id']) ) ; //
with parameters Echo chtml :: ImageButton (yii :: app ()-& gt; baseUrl. '/Images/Button2.png', Array ('Submit' = & GT; 'Controller2/Action2'); //

}

?>

This can be submitted.

But in the action of the controller

Cannot get POST www.2cto.com

if(isset($_POST['Post']))

{

// NEVER COME HERE

}


Author: georgelife7

http://www.bkjia.com/PHPjc/478091.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478091.htmlTechArticleCHtml::imageButton method can use an image as a button, but the submission method is not post, it may also be GET. Haven't tried GET. Write this in the view: ?php if(isset($_GET[id])) {...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template