According to https://docs.joomla.org/Plugin/Events/Content, it is Called after the data for a JForm has been retrieved.
It is not very clear when exactly the event is triggered.
Based on the documentation, I'd thought it is triggered after users click the submit button of a form and before the data of the form is actually submitted. But it doesn't seem so in reality.
To test it, I enabled the user-profile plugin, and in its profile.php
file, I put a var_dump
in the onContentPrepareData
function
public function onContentPrepareData($context, $data)
{
var_dump($data);
// Check we are manipulating a valid form.
if (!in_array($context, array('com_users.profile', 'com_users.user', 'com_users.registration', 'com_admin.profile')))
{
return true;
}
...
If my guess was right, when I open the editing page of a user's profile, this var_dump
will only trigger after users click 'submit" button. But actually the output of var_dump
is displayed when the page is loaded