Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In answer to your original question: sort of. Core PHP -> DOM, SimpleXML, SPL = templating engine. That's why (and how) templating engines such as Smarty exist. </p> <p><strong>Re: installing Tidy as suggested in comments,</strong></p> <p>Tidy has a prerequisite lib. If you don't already have it:</p> <p><a href="http://php.net/manual/en/tidy.installation.php" rel="nofollow">http://php.net/manual/en/tidy.installation.php</a></p> <blockquote> <p>To use Tidy, you will need libtidy installed, available on the tidy homepage » <a href="http://tidy.sourceforge.net/" rel="nofollow">http://tidy.sourceforge.net/</a>.</p> </blockquote> <p>To enable, you will need to recompile PHP and include it in your config flags: </p> <blockquote> <p>"This extension is bundled with PHP 5 and greater, and is installed using the <strong>--with-tidy</strong> configure option."</p> </blockquote> <p>So, get your existing config flags:</p> <pre><code>php -i | grep config </code></pre> <p>and add --with-tidy.</p> <hr> <p><strong>However, this is probably the wrong approach.</strong> <em>It does not solve your actual problem</em> (outputting XHTML instead of HTML) - it fixes Smarty's problem. Recompiling PHP to add an extension so you can use it to fix a templating engine's doctype shortcomings probably means you should consider using a different templating engine, if possible. That's sort of drastic (and adds a lot of overhead for what you get, which amounts to for a hacky non-solution bandaid workaround retroactively repairing broken output.) </p> <h2>PEAR's HTML_Template_PHPTAL is probably the best solution to your problem, and the closest answer to your original question.</h2> <p><strong>And if PHPTAL doesn't quite cut it, there are at least 5 others available as PEAR libs to choose from.</strong></p> <pre><code>pear install http://phptal.org/latest.tar.gz </code></pre> <p>Or it's been ported to Git:</p> <pre><code>git clone git://github.com/pornel/PHPTAL </code></pre> <p>A cursory google search: <a href="http://webification.com/best-php-template-engines" rel="nofollow">http://webification.com/best-php-template-engines</a></p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload