Hello
I have a PHP code the output of which I need to get as var: but I have seen that it does not work in V7. I am using {var:var_name} the name that I give to my PHP field.
could someone please tell me the right way to go about it?
Thanks
Ron
I have a PHP code the output of which I need to get as var: but I have seen that it does not work in V7. I am using {var:var_name} the name that I give to my PHP field.
could someone please tell me the right way to go about it?
Thanks
Ron
Several possibilities:
Did you do a "return $value;" at the end of your PHP field?
Did you have a {fn:var_name} before the {var:var_name}? You need to run the function prior to calling the variable output from the function.
Have you double check all the spellings of your functions and variables?
If you do a {debug:}, is the function var_name visible in the debugging code?
Did you do a "return $value;" at the end of your PHP field?
Did you have a {fn:var_name} before the {var:var_name}? You need to run the function prior to calling the variable output from the function.
Have you double check all the spellings of your functions and variables?
If you do a {debug:}, is the function var_name visible in the debugging code?
Hello wbuk.
Thanks for your post. I am sorry I did not understand your post.
{fn:var_name} before the {var:var_name} Could you please give me an example ?
Thanks
Ronn
Thanks for your post. I am sorry I did not understand your post.
Did you do a "return $value;" at the end of your PHP field?
Did you have a {fn:var_name} before the {var:var_name}?
{fn:var_name} before the {var:var_name} Could you please give me an example ?
Thanks
Ronn
Basically in your PHP field block, you should have something like this:
Function name "Hello":
Then on your HTML page, you do:
Result:
The {fn:Hello} has to come before {var:Hello}
Function name "Hello":
var $foo = "Hello world";
return $foo;
Then on your HTML page, you do:
{fn:Hello}
{var:Hello}
Result:
Hello world
The {fn:Hello} has to come before {var:Hello}
You have to upload it somewhere else (I used imgbb) then type:
{img}URL of image here{/img}
Change curly brackets to square brackets.
{img}URL of image here{/img}
Change curly brackets to square brackets.
That's fine we still can just open the URL.
Ah apologies I didn't know you were using the Advanced Form mode (I was using the Connectivity mode). If so you don't need the {fn:var_name}. Basically to get the output, you just use {var:isd} anywhere, as long as it's on the same page.
Ah apologies I didn't know you were using the Advanced Form mode (I was using the Connectivity mode). If so you don't need the {fn:var_name}. Basically to get the output, you just use {var:isd} anywhere, as long as it's on the same page.
{var:isd}
Thanks. I tried using the {var:isd} it did not work. I did not know that PHP has to be on the same page. I am going to try that out.
Ron
Ron
if your php module is called "php_pippo"and returns a value like this example,
try with {var:php_pippo}
var $rv = "Hello world";
return $rv;
try with {var:php_pippo}
You need to login to be able to post a reply.