I have a form that sends its data to a pair of TCPDF actions, each one slightly different than the other. I need to show the logged in user's Joomla name and email field in the tcpdf output. These two user fields are not being used anywhere in the form itself, they only show up on the pdf output.
I have read the documentation on adding a custom action to the onload event and have added this code to it:
<?php
$user = JFactory::getUser();
$form->data['user_name'] = $user->name;
$form->data['user_email'] = $user->email;
?>
I then added the following code to the tcpdf html:
<p>Coach Name: {user_name} ({user_email})</p>
But as you can probably guess it doesn't work. Am I writing things incorrectly or do I need to put something in the form itself to store those variables so that they get sent on to the TCPDF action? Those two fields are not being stored in the form database anywhere.
I have read the documentation on adding a custom action to the onload event and have added this code to it:
<?php
$user = JFactory::getUser();
$form->data['user_name'] = $user->name;
$form->data['user_email'] = $user->email;
?>
I then added the following code to the tcpdf html:
<p>Coach Name: {user_name} ({user_email})</p>
But as you can probably guess it doesn't work. Am I writing things incorrectly or do I need to put something in the form itself to store those variables so that they get sent on to the TCPDF action? Those two fields are not being stored in the form database anywhere.