2

is there any way to see the data that's being submitted in a content form?

I'm trying to use the onContentBeforeSave plugin event to do some actions based on the content in the form, but I'm not sure exactly what the data looks like so I know how to access it.

Is there any way to see the raw data that is being processed/submitted by the form?

2

To see the POST data from your form the code below at the beginning of your onContentBeforeSave function should do the trick:

var_dump($_POST); die;

Another option would be to investigate the POST request in a browser like Chrome (https://developer.chrome.com/devtools/docs/network) or Firefox.

  • thanks! the dev tools in Chrome got me just what I wanted. I poked around in there earlier, but couldn't find it - your link got me right where I needed to go :) – Jon Jul 27 '15 at 13:39
1

In Joomla, there are no specific debugging tools. You can work with any PHP development tool to inspect internal structures. Most developers work with Eclipse PHP or PHPStorm, among others.

To develop plugin, you can develop your logging routines to keep track of generated structured. For example:

$config = array(
    'text_file' => 'my-log.log';
);

jimport('joomla.log.logger.formattedtext');
$logger = new JLogLoggerFormattedtext($config);
$comment = ' - ' . print_r($data, true);

$entry = new JLogEntry($comment, $JLog::INFO);
$logger->addEntry($entry); 

In this way, a hand log file is generated in logs/ folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.