Remove $docidtrue = return $arrFeeds; and replace $docidtrue with $arrFeeds. It should work as you wanted.
It would look like that:
<?php
$doc = new DOMDocument();
$doc->load('http://www.domain.com/blog/feed/');
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
$itemRSS = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($arrFeeds, $itemRSS);
}
//And trying to parse the return into a template:
$view_doc->assign("DOCID", $arrFeeds);
?>
return is not what you wanted. Maybe you looked for break (which exits the whole current loop) or continue (which leaves current loop iteration and goes to the next one).
EDIT:
Because you need some string to be passed to assign() method, we can make something that will display the list of items instead of gathering them for further processing :)
<?php
$doc = new DOMDocument();
$doc->load('http://www.domain.com/blog/feed/');
$feeds = '';
foreach ($doc->getElementsByTagName('item') as $node) {
$feeds .= '<div>'
.'<h2>'.$node->getElementsByTagName('title')->item(0)->nodeValue.'</h2>' // title
.'<p>'.$node->getElementsByTagName('description')->item(0)->nodeValue.'</p>' // desc
.'<p><a href="'.$node->getElementsByTagName('link')->item(0)->nodeValue.'">link</a></p>' // link
.'<p>'.$node->getElementsByTagName('pubDate')->item(0)->nodeValue.'</p>' // date
.'</div>';
}
//And trying to parse the return into a template:
$view_doc->assign("DOCID", $feeds);
?>
This has to work :)
But remember - what I just did is just wrong. You should parse the variable resulting from the original solution within the template. I have just created it in the wrong place and passed generated string into the view. View is just for transforming data into displayable code (HTML).