Home > PHP Framework > YII > body text

Why does the yii verification code not refresh?

angryTom
Release: 2020-03-11 16:32:41
Original
2622 people have browsed it

Why does the yii verification code not refresh?

What is the reason why the yii verification code does not refresh?

The background login calls the verification code. Clicking the verification code does not refresh and there is no response (all verification codes Configuration and parameters are correct).

When I found the error, I found that the page where the verification code can be refreshed has an extra js code than the page where the verification code cannot be refreshed, which is used to handle the event of clicking the verification code to refresh.

(Related tutorial recommendation: yii framework)

Why is there a piece of code missing? It turns out that the controller calls renderPartial and render respectively. Let’s talk about their differences:

When rendering page output.

render Outputs the content of the parent template and embeds the rendered content into the parent template.

renderPartial does not output the content of the parent template. Only the partial content of this rendering is output.

At the same time, there is an important difference:

The processOutput($output) function is executed by default inside the render function, and the required scripts registered in CClientScript in components such as CTreeView will be rendered. output.

And renderPartial() does not automatically render and output the client script by default. Parameters need to be specified before it will be output:

renderPartial($view,$data=null,$return=false,$processOutput=false)
Copy after login

Specify processOutput as true.

Just like the problem we encountered, when using renderPartial, the page does not output the js that refreshes the verification code. So there is no reaction.

PHP Chinese website, a large number of PHP video tutorials, welcome to learn!

The above is the detailed content of Why does the yii verification code not refresh?. For more information, please follow other related articles on the PHP Chinese website!

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