Is php working in TCPDF function

vismay 28 Jun, 2017
Hello,

I was used to write some php function in old TCPDF for CF5. Is still possible in TCPDF for CF6?

Because I'm trying some basic code but is not working, only html and {data:field_name}.

Thanks
GreyHead 28 Jun, 2017
Hi vismay,

I don't' know if you can use PHP in the action in CFv6 :-(

What you can of is use a custom action before the action to build the HTML you need, add it to the form data and then display it in the TCPDF action.

Bob
vismay 28 Jun, 2017
In CF5 yes...

Ok, I will try...
thanks
Max_admin 29 Jun, 2017
Hi,

In v6 it can be done using either the old method explained by Bob or by using a PHP function and returning the end value then using {var:php_name} in the contents of the TCPDF.

The custom code itself can also be configured to set the output as a variable for later usage.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vismay 29 Jun, 2017
I can understand, but how I can transfer to tcpdf such a function:

if ( $conta == 1 ) {

echo "";}
else {
foreach ( $form->data['recipient'] as $k => $v ) {

  echo "<div><strong>{$v['name']} {$v['cognome']}, {$v['nascita']} {$v['nascita_o']} {$v['nascita_oso']} {$v['gg']}-{$v['mm']}-{$v['yyyy']}, {$v['cittadinanza']} ({$v['sesso']})</strong></div>";
}
}
Max_admin 29 Jun, 2017
Answer
Hi vismay,

Is this code inside a PHP function ?

If yes then just move it inside a "custom code" action instead and use a php tag before the code <?php, then enable the "return result as var" setting, if the "custom code" is before the TCPDF then you can use this to get the code results:
{var:custom_code_name}

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vismay 30 Jun, 2017
Thanks, I will try.
vismay 30 Jun, 2017
1 Likes
Yes, works!!! Thanks for help!
This topic is locked and no more replies can be posted.