(solved) Smarty vars to PHP? Confused (very)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

(solved) Smarty vars to PHP? Confused (very)

Post by sarah_h »

Hi,

I'm trying to do something VERY simple here and I'm falling at the first hurdle it seems!

I have this in a template:
Reserve Request

So this just attaches the smarty variable for the displayed calendar event. This works ok. I also saw how I could use CMS selflink from a post by Calguy1000 to do the same.

But I now need to get the var from the url and retrieve parts of the event record. I can do this to do this:
ID={$smarty.get.performanceID}

This works too. So I've got the ID of the event I'm after but now I'd like to pass that eventID var to PHP so I can do more stuff within UDT's. This is where I'm lost. I've read some of the smarty manual and it mentions how to pass PHP vars to Smarty but not the other way i.e. from Smarty to PHP.

I think (I know) I'm missing something simple here. Can anyone help?

Sarah
Last edited by sarah_h on Sat Mar 22, 2008 4:16 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Smarty vars to PHP? Confused (very)

Post by calguy1000 »

take a look at $smarty->get_template_vars in the smarty manual
also, you can pass variables into a UDT on the udt tag {myudt variable1=value1 variable2=value2}

then you'd extract their values with $params['variable1'] inside the UDT.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Re: Smarty vars to PHP? Confused (very)

Post by sarah_h »

Thanks for that, I knew about get_template_vars but even though I looked through the Smarty manual I didn't see the {myudt variable1=value1 variable2=value2}, but is that because this is a CMSMS thing? I guess so. Anyway it seems that's what I needed, so thanks so much.

BTW I'm really getting into your Calendar module, it's so excellent!!

Sarah
alby

Re: Smarty vars to PHP? Confused (very)

Post by alby »

sarah_h wrote: but is that because this is a CMSMS thing?
Parameters for tags

Alby
Post Reply

Return to “CMSMS Core”