doctype, config variables in plug-in
| From: | Peter Turcan | Date: | Mon, 08 Jul 2002 07:14:40 +0000 |
| Subject: | doctype, config variables in plug-in | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5219@lists.php.net to get a copy of this message | ||
Hello to all
Because of validation of html page I want to send doctype at the
beginning of html.
I can't find this in smarty, so I have created plug-in
html_transitional:
----------------
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: function
* Name: html_transitional
* Author: Peter Turcan <peter.turcan@zoznam.sk>
* Purpose: print doc type for html4.01 transitional
* -------------------------------------------------------------
*/
function smarty_function_html_transitional($params, &$smarty)
{
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01
Transitional//EN\">\n";
}
?>
----------------
and into template you can simply enter:
{html_transitional}
And simmilar for frameset/strict types..
hm. looks fine, but is there another built-in solution for that?
oh, still one question. How can I access in plug-in fuction to
variables loaded from config file (by config_load function)?
thanks
Peter