debugging of data read with phpQuery

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
mstdmstd
New php-forum User
New php-forum User
Posts: 32
Joined: Sun Mar 30, 2014 4:45 am

Tue Oct 24, 2017 10:40 pm

Hello,
Can you advice some tools(php7/laravel5) for debugging/review of data read with phpQuery?
I mean when I need to get data-attribute of H2 tag I write:

Code: Select all

$pq = pq($nextContainerDivItem);
$nextTitle= $pq->find('h2.s-access-title');
echo '<pre>$nextTitle::</pre>';
dump($nextTitle);
$next_title= !empty($nextTitle->attr('data-attribute') ) ? $nextTitle->attr('data-attribute')  : '';
I googled the right decision and now in $next_title valid value, but debugging the output
https://imgur.com/a/bwEKS

is not really usefull, as I could not review the value in dumping: I suppose to find it in path elements->attributes,
but as you see at printscreen.

If there isa better of dump( ? If possible with options to show some nodes. Say not empty or specifile in path, as if ["elements->attributes"]
specified show it opened.

Thanks!

mstdmstd
New php-forum User
New php-forum User
Posts: 32
Joined: Sun Mar 30, 2014 4:45 am

Fri Oct 27, 2017 6:47 am

I still search some tools to output for data found with phpQuery requests.

when I write piece of code above I have some output like in printscreen above,
but it is difficult to review it.
And even I write wrong path/class I have some output like in printscreen above.
I would like in some way to show if the node was found or not?
If there is way to make it?
Which debugging tools do you use with phpQuery requests ?

Post Reply