Have you tried to remove the test on if (isset($this-
>params['requested'])) ? and return always categories.
in your request action call you could pass :
$categories = $this->requestAction('/categories/getCategories/0',
array('requested' => true));
I am not sure that will fix the problem, but that might give you some
hints
On Jun 29, 5:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm new to cake and I have been reading a lot about the
> requestAction() inside of Element. I've found a nice article on the
> Bakery and several helpful discussions on the lists here. However,
> for some reason when I run the requestAction() it hangs my server.
> I'm trying this on my local machine on a virtual host athttp://127.0.0.1:82/
> While I don't see why that would cause things to hang I'm thinking it
> maybe my code so please view below and see if I'm just not seeing
> something.
>
> Thanks.
>
> in /app/views/layouts/default.thtml
>
> <?php echo $this->renderElement('categories'); ?>
>
> in /app/controllers/category_controller.php
>
> function getCategories($level) {
> $categories = $this->Category->findByLevel($level);
> if (isset($this->params['requested'])) {
> return $categories;
> }
> $this->set('categories', $categories);
>
> }
>
> in /app/views/elements/categories.thtml
>
> <?php
>
> $categories = $this->requestAction('/categories/getCategories/0');
> print_r($categories);
>
> ?>
>
> If I comment out $categories = $this->requestAction('/categories/
> getCategories/0'); it works fine (of course it doesn't return the data
> I want but it doesn't hang the site).
>
> Any ideas on what might be the problem?
>
> Thanks for any help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---