WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: Shefra on June 22, 2012, 10:15:02 AM

Title: Return value
Post by: Shefra on June 22, 2012, 10:15:02 AM
Hello, i 'm unfamiliar with droplets and maybe is this question ask before.

Is it possible to add the return value into a variable?

Thanks in advance

Title: Re: Return value
Post by: BlackBird on June 22, 2012, 10:53:43 AM
I don't understand what you're after. Can you explain it a little bit more?
Title: Re: Return value
Post by: Shefra on June 22, 2012, 12:25:29 PM
Normally when you call a function you can place the return information into a variable like:

$variable = function();

So the the variable $variable get the value of the function
Title: Re: Return value
Post by: DarkViper on June 22, 2012, 01:17:24 PM
Droplets are not functions to call somewhere in your template.

Droplets are dynamical outputfilters only.
They only generating replacements for a search-replace-function which will be executed in the last moment, before the content is sent to the browser.

If you need functions to return values for advanced use during runtime of your template, then you must use 'snippets'.

See:  Additional functions (code snippets) (http://www.websitebaker2.org/en/help/developer-guide/wb-module-types.php?lang=EN#anker3)