Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
yii如何使用renderPartial生成DOM_Dom_Yii_Renderpartial - Fatal编程技术网

yii如何使用renderPartial生成DOM

yii如何使用renderPartial生成DOM,dom,yii,renderpartial,Dom,Yii,Renderpartial,我面临着Yii关于DOM的一些奇怪行为:我有以下代码 <div class="large-3 columns"> <?php $this->renderPartial("/categories/_small"); echo "some test text"; ?> </div> <footer> This is a footer </footer> 这是一个页脚 生成的html与我预期的有所不同: &

我面临着Yii关于DOM的一些奇怪行为:我有以下代码

<div class="large-3 columns">
   <?php $this->renderPartial("/categories/_small");  echo "some test text"; ?>
</div>
<footer>
   This is a footer     
</footer>

这是一个页脚
生成的html与我预期的有所不同:

<div class="large-3 columns">
   ... text from render partial goes here ... 
  <div style="clear:both;"> some test text </div>
  <footer> This is a footer </footer>
</div>

... “渲染部分”中的文本位于此处。。。
一些测试文本
这是一个页脚
为什么所有文本都在第一个div中?为什么一些测试文本出现在我没有键入的某个div中?我认为它与渲染部分有关,因为当它不存在时,一切都会按预期进行

另外,根据要求,我添加了希望作为输出的html:

<div class="large-3 columns">
   text from render partial goes here 
   some test text <--- NO ADDITIONAL DIV TAG IS APPENDED
</div>
<footer> This is a footer </footer>

“渲染部分”中的文本位于此处

一些测试文本我找到了这种行为的根源。它与渲染部分无关。问题出在文件_small中,该文件引用了包含unclosed tag DIV的文件扩展名/CDropDownMenu.php。这就是错误的标记嵌套的根源


由于在上的讨论,我设法解决了这个问题。

您能告诉我您想要的确切输出吗。那就更容易回答了。