Strip <HTML>,<BODY> and similar from the beginning
| From: | Victor | Date: | Mon, 12 Mar 2001 16:13:21 +0000 |
| Subject: | Strip <HTML>,<BODY> and similar from the beginning | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-377@lists.php.net to get a copy of this message | ||
> You can put
>
> preg_replace('<head>', '', $template_contents);
> preg_replace('</head>', '', $template_contents);
>
> ...etc in Smarty_Compiler.class.php, in function
> _compile_file($filepath, $compilepath), after the line
> $template_contents = preg_replace("!{$l.... blabla
Perfect! Just the sort of solution I wanted. But does check if it's an included file, or does
it do that for all files? Well, it's easier for me to test it.
But I'll have to add support for <html><body ..... > (long tag>,
</html>,</body>,<meta>, <link ...> etc, etc..
*I* think this function should be included in the original dist. Maybe inactivated by default, but
it should be easy to turn it when needed.
Thanks!
// Victor