php using zend framework does not print html properly
I am using zend framework...
so I have the following code in display.php:
<?php
class display{
public static function displayYeaa(){
?>
<?php
self::displayHaHa('lol','LOL');
?>
<?php
}
public static function displayHaHa($type = 'lol',$text = 'LOL'){
?>
<a class="like" href="javascript:;" id="<?php echo $type; ?>Asdf" class="hahha">
</a>
<?php
}
}
?>
then I call the code from a zend framework view .phtml file...
<?php
require_once('display.php');
display::displayYeaa();
?>
but the output is really weird:
<a id="lolAsdf" href="javascript:;" class="like">
</a>
notice that the id is outputted BEFORE the href, class="like" ends up being last, and class="hahha" ends up not being printed at all (I know that you shouldn't have 2 class tags, but it's still interesting why it's not printing the second class)...
anybody knows what's wrong? I know the code is mumble jumble, but this is more for experimentati开发者_运维问答on purpose and it still baffles me why it's not printing as I'm telling it to...
If you actually view the page source as opposed to looking at your browser's DOM inspector, you would see that it is in fact rendering as expected.
精彩评论