I'm getting a fatal error regarding my memory being exhausted when
performing a very basic CakePHP operation. I'm not sure why I'm
getting it or what I can do to fix it. Hopefully someone else can see
what's wrong with my code since I seem to be missing something.
Here's what I'm doing in my view:
<?php echo $this->element('blog-posts', array('cache'=>'+1 hour'));?>
And here's what my blog-posts.ctp elements file looks like:
<?php $posts = $this->requestAction('/members/getBlogPosts');?>
<?php if (empty($posts)):?>
<p>No articles have been posted recently.</p>
<?php else:?>
<ul class="tight">
<?php foreach ($posts as $link => $title):?>
<li><a href="<?php echo $link;?>"><?php echo
$title;?></a></li>
<?php endforeach;?>
</ul>
<?php endif;?>
Here is my function "getBlogPosts" that is being called. Note that I
still get the same error even with the bulk of my code commented out.
function getBlogPosts() {
uses('Xml');
//$feed = $this->_xmltoArray(new XML(WEB_ROOT.'/blog/rss'));
//$posts = (empty($feed) || empty($feed['rss']['channel']['item'])) ?
null : array_combine(
// Set::extract($feed, '/rss/channel/item/link/#text'),
// Set::extract($feed, '/rss/channel/item/title/#text')
//);
//return $posts;
return null;
}
I'm not sure what the problem is in my code, and it's driving me
crazy! Anyone see anything out of the norm here? If not, I'll have
to look through prior code to see if it's something else taking up all
the memory.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---