26/06/2012 9:27am

PHP | Problem - unable to render array data


in controller 


static function getExtensionAuthorsInfo($ExtensionData) {
$AuthorsInfo = unserialize($ExtensionData->AuthorsInfo);

return array(

'AuthorName'=>$AuthorsInfo['0']['name'],
'AuthorEmail'=>$AuthorsInfo['0']['email'],
'AuthorHomePage'=>$AuthorsInfo['0']['homepage'],
//'AuthorRole' => $AuthorsInfo['0']['role']
);

function show() {
if($ExtensionData = $this->getExtensionData())
{
$Data = array(
'MetaTitle' => $ExtensionData->Name,
'ExtensionData' => $ExtensionData,
'SubmittedBy' => $this->getExtensionSubmittedBy($ExtensionData),
'Keywords' => $this->getExtensionKeywords($ExtensionData),
'AuthorsDetail'=> $this->getExtensionAuthorsInfo($ExtensionData),
);
return $this->customise($Data)->renderWith(array('Module_show', 'Page'));
//todo .. not rendering header and navigation templates from theme
}
else
{
return $this->httpError(404, 'Sorry that Module could not be found');
}
}


in template

<% if $AuthorsDetail %>
<h1>$AuthorsDetail</h1>
<% control ExtensionData %>
<ul>
<h2>Authors Detail</h2>
<li>
Author Name : $AuthorName
</li>
<li>
Author Email : $AuthorEmail
</li>
<li>
Author HomePage :
<a href="$AuthorHomePage "> $AuthorHomePage> </a>
</ul>
<% end_control %>

<% end_if %>



Post Comment