I am having a very strange issue i have a xml file structure like this
<hooks>
<hook module="socialsharing" hook="displayHeader" position="1"/>
<hook module="socialsharing" hook="displayRightColumnProduct" position="1"/>
<hook module="socialsharing" hook="actionObjectProductUpdateAfter" position="1"/>
<hook module="socialsharing" hook="actionObjectProductDeleteAfter" position="1"/>
<hook module="socialsharing" hook="displayCompareExtraInformation" position="1"/>
<hook module="blockbanner" hook="displayHeader" position="2"/>
<hook module="blockbanner" hook="displayBanner" position="1"/>
<hook module="blockbanner" hook="actionObjectLanguageAddAfter" position="1"/>
<hook module="blockbestsellers" hook="displayLeftColumn" position="1" exceptions="category"/>
<hook module="blockbestsellers" hook="displayHeader" position="3"/>
<hook module="blockbestsellers" hook="actionProductAdd" position="1"/>
<hook module="blockbestsellers" hook="actionProductUpdate" position="1"/>
</hooks>
And This is the code snipplet i am working with
if($xmlHooks=simplexml_load_file(_PS_ROOT_DIR_.'/assests/hooks.xml'))
{
foreach ($xmlHooks as $xmlHook)
{
die(print_r($xmlHook->attributes()->module));
}
}
BUt it always output me no matter how i acess it
SimpleXMLElement Object
(
[0] => socialsharing
)
Just want to get socialsharing freely not in array or object so i can use this word further
Thanks!
Tiada ulasan:
Catat Ulasan