简体   繁体   English

Yii2错误:达到“100”的最大功能嵌套级别,正在中止

[英]Yii2 error:Maximum function nesting level of '100' reached, aborting

In _form.php I am trying to use this simple code and I am getting the error: 在_form.php中我试图使用这个简单的代码,我收到错误:

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\State;



/* @var $this yii\web\View */
/* @var $model app\models\State */
/* @var $form yii\widgets\ActiveForm */

 $model = new State();
?>



<?= $this->render('_form', [
        'model' => $model,
        ]) ?>

Why I am getting this error. 为什么我收到此错误。 As the same code was working fine. 因为相同的代码工作正常。

If that is indeed code from "_form.php", then the following code is recursively rendering _form.php inside itself: 如果那确实是来自“_form.php”的代码,那么下面的代码将递归地呈现_form.php:

<?= $this->render('_form', [
        'model' => $model,
        ]) ?>

Joshi is correct, and the reason it's happening is because that you're calling render() instead of renderPartial(). Joshi是正确的,它发生的原因是因为你正在调用render()而不是renderPartial()。 Change your code to this, and the error will disappear and your partial will show as expected: 将您的代码更改为此,错误将消失,您的部分将按预期显示:

<?= $this->renderPartial('_form', [
        'model' => $model,
    ]) ?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 达到最大功能嵌套级别&#39;100&#39;,中止 - Maximum function nesting level of '100' reached, aborting 具有Sentinel 2的Laravel 5.2-达到最大功能嵌套级别&#39;100&#39;,正在中止 - Laravel 5.2 with Sentinel 2 - Maximum function nesting level of '100' reached, aborting PHP Singleton:达到最大功能嵌套级别“ 100”,正在中止 - PHP Singleton : Maximum function nesting level of '100' reached, aborting 达到最大功能嵌套级别“ 100”,从而中止了Laravel 5.1 - Maximum function nesting level of '100' reached, aborting Laravel 5.1 PHPUnit显示达到的最大函数嵌套级别&#39;100&#39;,正在中止 - PHPUnit displays Maximum function nesting level of '100' reached, aborting 达到最大嵌套等级100,中止! - PHP - Maximum Nesting Level of 100 Reached, Aborting! - PHP 我收到“致命错误:达到&#39;100&#39;的最大函数嵌套级别,正在中止!”错误使用glob()。 为什么? - I'm getting “Fatal error: Maximum function nesting level of '100' reached, aborting!” error using glob(). why? FPDF 错误,致命错误:达到“100”的最大函数嵌套级别,正在中止 - FPDF Error, Fatal error: Maximum function nesting level of '100' reached, aborting PHP致命错误:函数最大嵌套级别达到&#39;100&#39;,正在中止! 在Laravel - PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in Laravel 如何修复laravel 5.2这个错误“达到&#39;100&#39;的最大函数嵌套级别,正在中止!”? - How to fix laravel 5.2 this error "Maximum function nesting level of '100' reached, aborting!"?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM