kamikaze_pilot
kamikaze_pilot

Reputation: 14844

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 experimentation purpose and it still baffles me why it's not printing as I'm telling it to...

Upvotes: 0

Views: 403

Answers (1)

Phil
Phil

Reputation: 165069

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.

Upvotes: 1

Related Questions