Closed (fixed)
Project:
Views PHP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2012 at 06:09 UTC
Updated:
27 Jul 2012 at 10:01 UTC
I have a global:view field in my view and have selected a view 'table_teachers'.
I would like to use this in my global:php field.
If there are values in the global:view field then echo...
I have the code:
$previous = ($data->views_view_table_teachers[0]['raw']['value']);
if($previous == TRUE)
{echo 'Teachers';}
else{}
?>
I'm not sure how to write the line ($data->views_view_table_teachers[0]['raw']['value']);
I tried doing the same as if it was a field but it doesn't work.
Any ideas I couldn't find any documentation on this.
Thanks
Comments
Comment #1
rogical commentedTry dpm($variable) function from devel module to output the $variable structure.
Comment #2
LTech commentedThanks, I did it using
$block = module_invoke('views', 'block_view', 'table_of_teachers-block_1');
if (render($block['content']) == TRUE) {
echo 'Teachers';
echo '
';
}
else{}
Comment #3.0
(not verified) commentedtypo