Savant question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to use savant and having a few odd problems. I plan on making a simple DB driven site where the majority of the content is held in the DB. I have created a basic template (header, footer, nav and content) to just echo out the content (the content will have a html to format it the way I want). Simple right.

Problem: All the html mark up is being ignored and the content is just "dumping" there. Check for htmlentities you say... did and they are there. So I try to get rid of it with html_entity_decode - thus giving me my html formating back right? Wrong. Same problem. Am I missing something?

index.php

// here we get content. Normally this will be by pulling it out of the DB
   $savant->content = '
       <center>
       <h2>This is a test of the Emergency Broadcasting System</h2>
<p>This is <font color="#008000" size="5">ONLY</font> a test. If this was a real emergancy information would be provided here. This is a test.</p>
       </center>';

   $savant->display('page.tpl.php');


page.tpl.php

 <div id="cont">
    <?php
    if(!empty($this->content))
   {
        echo "{$this->_($this->content)}";
        echo '<----------------------- Break --------------------------->';
        echo html_entity_decode($this->_($this->content));
    }
    ?>
 </div>

displayed in browser page:

<center> <h2>This is a test of the Emergency Broadcasting System</h2> <p>This is <font color="#008000" size="5">ONLY</font> a test.</p> </center><----------------------- Break ---------------------------> <center> <h2>This is a test of the Emergency Broadcasting System</h2> <p>This is <font color="#008000" size="5">ONLY</font> a test.</p> </center>

browser page source:

<div id="cont">
				
 &lt;center&gt;
 &lt;h2&gt;This is a test of the Emergency Broadcasting System&lt;/h2&gt;
 &lt;p&gt;This is &lt;font color=&quot;#008000&quot; size=&quot;5&quot;&gt;ONLY&lt;/font&gt; a test.&lt;/p&gt;

 &lt;/center&gt;<----------------------- Break --------------------------->
 &lt;center&gt;
 &lt;h2&gt;This is a test of the Emergency Broadcasting System&lt;/h2&gt;
 &lt;p&gt;This is &lt;font color=&quot;#008000&quot; size=&quot;5&quot;&gt;ONLY&lt;/font&gt; a test.&lt;/p&gt;

 &lt;/center&gt;			
</div>


--
Respectfully,
Ligaya Turmelle

"Life is a game.... so have fun"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux