Hi! I'm still kind of struggling with the new concept of CF6 and tags like {data:...} and {var:...) etc. So for my understanding:
When I want to use PHP to create a new value (like the page title, or a calculation, or whatever), how do I get this in the data / email of the form?
Do I need to add a PHP script in the setup 'load' section in the form to create the new value like this:
<?php $myVariable = "test";?>
And the add this somehow as a value to a hidden form elemenent? How?
Or can I use this PHP variable in the email body without adding it to a hidden field? How?
Or are both option possible?
Hope you can help me clarify this ;-) Thanks!
Kind regards,
Jip
When I want to use PHP to create a new value (like the page title, or a calculation, or whatever), how do I get this in the data / email of the form?
Do I need to add a PHP script in the setup 'load' section in the form to create the new value like this:
<?php $myVariable = "test";?>
And the add this somehow as a value to a hidden form elemenent? How?
Or can I use this PHP variable in the email body without adding it to a hidden field? How?
Or are both option possible?
Hope you can help me clarify this ;-) Thanks!
Kind regards,
Jip
Hi Jip,
Please see the examples at the foot of Page 34 in the manual
Bob
Please see the examples at the foot of Page 34 in the manual
$this->set('var_name', 'value);
You can use this in a Custom Code action in the form On Load or On Submit event and then use the data like any other data item in later actions.
Bob
So when I add this:
$this->set('mytest', 'hello');
I can use it like this: {data:mytest} ?
$this->set('mytest', 'hello');
I can use it like this: {data:mytest} ?
This topic is locked and no more replies can be posted.