0
stdClass Object (
[id] => 105
[menutype] => englishmenu
[title] => Product Verification
[alias] => product-verification
[note] =>
[path] => software-outsourcing/product-verification
[link] => index.php?option=com_content&view=article&id=2
[type] => component
[published] => 1
[parent_id] => 103
[level] => 2
[component_id] => 22
[ordering] => 0
[checked_out] => 0
[checked_out_time] => 0000-00-00 00:00:00
[browserNav] => 0
[access] => 1
[img] =>
[template_style_id] => 0
[params] => {\"show_title\":\"\",\"link_titles\":\"\",\"show_intro\":\"\",\"show_category\":\"\",\"link_category\":\"\",\"show_parent_category\":\"\",\"link_parent_category\":\"\",\"show_author\":\"\",\"link_author\":\"\",\"show_create_date\":\"\",\"show_modify_date\":\"\",\"show_publish_date\":\"\",\"show_item_navigation\":\"\",\"show_vote\":\"\",\"show_icons\":\"\",\"show_print_icon\":\"\",\"show_email_icon\":\"\",\"show_hits\":\"\",\"show_noauth\":\"\",\"urls_position\":\"\",\"menu-anchor_title\":\"\",\"menu-anchor_css\":\"\",\"menu_image\":\"\",\"menu_text\":1,\"page_title\":\"\",\"show_page_heading\":0,\"page_heading\":\"\",\"pageclass_sfx\":\"\",\"menu-meta_description\":\"\",\"menu-meta_keywords\":\"\",\"robots\":\"\",\"secure\":0}
[lft] => 50
[rgt] => 51
[home] => 0
[language] => en-GB
[client_id] => 0
)

Well that is the $item variable content I print_r and I am using Joomla. Clearly there is a property named "menu_image" but when I run my application I always run into the notice that the stdclass::menu_image property is not defined, I am really confused, and can only seek help from this true magicians's site. Any help would be highly appreciated, I thank you so very much for all.

Andreas Wong
  • 59,630
  • 19
  • 106
  • 123
Yabooo Yakhoo
  • 27
  • 1
  • 1
  • 5

1 Answers1

0

No, it doesn't exist as a direct property of that object, rather it's a json encoded string:

$params = $obj->params;
$params = json_decode($params);
echo $params->menu_image
Andreas Wong
  • 59,630
  • 19
  • 106
  • 123