Forums / Cotonti / Extensions / PHP.out?

geting $var

Dave
#1 2009-05-19 21:48
i have standalone plugin (clan roster based on team plugin)


nothing special :p but i was trying to get $status @ index,

i fould @ neocrome.net:

Set the hook as global, for tags, you just use the {PHP.*} tag
Example, if your var is called $myvar in your plugin, you'll use {PHP.myvar} in your TPL files, or if your var is $out['myvar'] you'd use {PHP.out.myvar}

but {PHP.status} or {PHP.out.status} doesnt work... help ?

*bump*
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
This post was edited by Dave (2009-07-13 05:18, 14 years ago)
Trustmaster
#2 2009-07-13 06:40
It depends on when you link to that variable. In Cotonti <= 0.0.5 it has to be assigned before XTemplate object is constructed. In 0.0.6 there will be no such limitation.
May the Source be with you!
Lombi
#3 2009-07-13 07:02
It also needs to exist globally or at least in that location. So if it's not in the location you want to place it in (whatever.tags) try to make that part global.

Then it'll work :)
<a href="http://www.domenlo.com">Surreal Art</a>
Dave
#4 2009-07-13 12:33
i tryed Hooks=global, is that what u mean?
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
Trustmaster
#5 2009-07-13 13:24
No, he meant it has to be in global scope.
May the Source be with you!
Dave
#6 2009-07-13 13:30
mine english and php knowlage lack here :-/ so any tips how to do it?

*bump*
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
This post was edited by Dave (2009-07-13 21:29, 14 years ago)
Trustmaster
#7 2009-07-13 23:16
Wait 2 days for 0.0.6 release and {PHP.status} will work for you there.
May the Source be with you!
Dave
#8 2009-07-25 01:43
# Trustmaster : Wait 2 days for 0.0.6 release and {PHP.status} will work for you there.

so will it be correct? atm i updated to: http://www.cotonti.com/downloads/releases/cotonti_genoa_6 and this isnt working :s

or simply should i try to make roster.index.php and include tags inside? and what about that global thing if its not Hooks=global? :s
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
Trustmaster
#9 2009-07-25 03:42
It doesn't need Hooks=global. But that's really strange {PHP.status} doesn't work for you
May the Source be with you!
Dave
#10 2009-07-25 04:05
i wont give up, ill keep trying ... thx for help, i hope i can count on u :P

Added 6 minutes later:

i tryed: {PHP.status} {PHP.out.q3roster} .. no result ...

ill try to make it like minichat, plugin.index.php (with tags inside)
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
This post was edited by Dave (2009-07-25 04:12, 14 years ago)
Trustmaster
#11 2009-07-25 05:34
Try assigning it a tag:
$t->assign('PLUGIN_ROSTER_STATUS', $status);
May the Source be with you!