Event SmartyPreCompile - variable with text passed by reference?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Vin

Event SmartyPreCompile - variable with text passed by reference?

Post by Vin »

I need some more explanation into this - sorry if this sounds dumb, but I'm really not sure.

In the help of this event, I read :
'content' - Reference to the affected content text.
Does it mean that this variable (accessible with $params['content']) is  passed by reference and when I modify its contents in a UDT appended to the event, my changes will affect the variable which was used as an argument in Events::SendEvent and be stored in the database?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Event SmartyPreCompile - variable with text passed by reference?

Post by calguy1000 »

Yes, you're passed a reference to the content object.

You can change the object, and call the Save() method to have those changes reflected in the database.
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.
Post Reply

Return to “Developers Discussion”