0

I'm facing something strange behaviour of Yii concerning DOM: I've got the following code

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

The generated html is something different form what I expect:

<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>

Why does all the text come inside the first div? Why does some test text come inside some div that I have not typed? I suppose that it has something to do with renderPartial, because when it is absent, everything goes as expected.

P.S. As requested, I add the html I'd like to have as output:

<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>
Andrew
  • 2,148
  • 5
  • 23
  • 34

1 Answers1

0

I've found the origin of this behaviour. It has nothing to do with renderPartial. The problem was in the file _small that was referring file extensions/CDropDownMenu.php that contained unclosed tag DIV. This was the origin of erreneous tag nesting.

I managed to fix the probelm due to discussion on the yiiframework forum.

Andrew
  • 2,148
  • 5
  • 23
  • 34