Re: [SMARTY] debug console - mad idea
| From: | Monte Ohrt | Date: | Thu, 20 Mar 2003 15:07:12 +0000 |
| Subject: | Re: [SMARTY] debug console - mad idea | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8770@lists.php.net to get a copy of this message | ||
I think this kind of info is out of scope for Smarty. It is a template
engine, not a develpment environment. The debug console lets you know
values assigned to templates and the execution times of them. Although
Smarty has mechanisms to access the PHP super globals directly, they
really aren't considered to be part of the engine. In all correctness,
you should assign values you plan to use in the templates.
Try putting this in your Smarty class extention:
My_Smarty extends Smarty {
function My_Smarty() {
Smarty::Smarty();
$this->assign('_POST', $_POST);
$this->assign('_GET', $_GET);
$this->assign('_SERVER', $_SERVER);
}
}
(note: AFAIK, PHP 4 will create internal references and increment ref
counters for these arrays, not make copies)
Now your vars will show up in the debug console.
Monte
On Thu, 2003-03-20 at 05:30, Pete Morganic wrote:
> During programming I leave debug window on ..
>
> So here's the dream.
>
> Have a set of tabs at the top (just like phpmyadmin) for switching
> between different debug data. This could be accomplished using layers
> maybe ;-)
>
> The tabs are:
> Smarty | $_GET vars | $_POST vars | $_SERVER vars | etc..
>
> Gonna try an start coding but me not a Javascript expert (yet)
>
> nicec day everyone - the sun is shining in wales ..
>
> pete
>
--
Monte Ohrt <monte@ispi.net>