Home >
Backend Development >
PHP Tutorial >
How to implement multi-button saving and submission in Yii, how to implement button submission in Yii_PHP tutorial
How to implement multi-button saving and submission in Yii, how to implement button submission in Yii_PHP tutorial
WBOY
Release: 2016-07-13 10:12:20
Original
773 people have browsed it
Yii implements multi-button save and submit method, yii implements button submission
The example in this article describes how Yii implements multi-button save and submit without conflict. This is a problem that many beginners have encountered but don’t know how to solve. I’ll share it with you below for your reference. The specific method is as follows:
Only CForm in Yii can use the submitted() method. Use if($form->submitted('submit')) to determine whether the button whose buttonName is submit is clicked, such as: Form:
But CActiveForm does not have this method. One solution is to use classical html writing:
Copy code The code is as follows:
>
if(isset($_POST['submityes']))
That's it.
The final running effect is shown below:
I hope this article will help you design PHP programs based on the Yii framework.
http://www.bkjia.com/PHPjc/920978.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/920978.htmlTechArticleYii implements multi-button saving and submission methods, yii implements button submission. This article describes the example of Yii implementing multi-button saving and submission. Submit and conflict-free implementation method. This is something many beginners have encountered...
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