Ez template engine, debug

Ez template engine, debug

Friday 16 June 2006 4:02:23 pm - 4 replies

Modified on Friday 16 June 2006 4:08:25 pm by Muu Sle

Author Message

Patrick Kaiser

Sunday 18 June 2006 3:25:42 am

hi,

have a look at the 'dynamic debug' contribution. its a big improovement to the build in 'attribute|show' opperator.. http://ez.no/community/contribs/hacks/dynamic_debug

since the node object in ez publish is ways bigger than arrays/objects you would normally assign to a smarty template, it wouldnt be a good appoach to display all attributes of $node in ez by default (although you can define the disered depths in attribute|show ).

Anyway - you won't be able to debug effectivly if you don't know the names of your attributes..

cheers, patrick


Best regards,

Patrick

Muu Sle

Sunday 18 June 2006 6:21:34 am

Actually, a whole lot bigger! =)

Thanks for the tip, the extension really looks great, I will give it a go!

For the knowing the name of the variable part; what I meant was in Smarty debug there's a list of variables passed to the template engine per name, not necessarily the actual content of each and every variable.
Though the $node var is indeed the most important one, it would be nice in some occasions like dealing with collectors and customizing xml tags for the first time when you're not really sure what variables are present.

. muusle

Kristof Coomans

Sunday 18 June 2006 11:40:38 pm

You mean something like the get_defined_vars function of PHP ( http://be2.php.net/manual/en/function.get-defined-vars.php ) ?

That would be a nice addition. Template writers who don't have any knowledge about the kernel now have to take a look in the specific modules to see what's passed by to the template.

Can you post an enhancement request for this?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Muu Sle

Monday 19 June 2006 4:08:40 am

Hi Kristof,

> You mean something like the get_defined_vars function of PHP
Exactly like the get_defined_vars.

// print all the available keys for the arrays of variables
print_r(array_keys(get_defined_vars()));

I think this would help many first timers and perhaps the more experienced ones too, when working with extensions and such.

> Can you post an enhancement request for this?
Will do.

. muusle

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.