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

rogical’s picture

Status: Active » Fixed

Try dpm($variable) function from devel module to output the $variable structure.

LTech’s picture

Thanks, I did it using
$block = module_invoke('views', 'block_view', 'table_of_teachers-block_1');
if (render($block['content']) == TRUE) {
echo 'Teachers';
echo '
';
}
else{}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

typo