Why does RequestHandler::beforeRedirect() "fake" AJAX redirects?

2014-02-18 Thread SacoDesign
I have a general question regarding the logic inside of 
RequestHandler::beforeRedirect() related to AJAX redirects.  Why does 
CakePHP try to "fake" a redirect- why not just do a true redirect?

This logic appears to be confusing the Security Component in my application 
(and I don't want to disable the Security Component in any way).  I'm 
curious what is the purpose of using a requestAction() call?  When I remove 
the ajax handling in the RequestHandler::beforeRedirect() my application 
works perfectly.

Thanks for any insight you can provide.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Router::connect() not behaving as expected in 1.3?

2010-08-31 Thread SacoDesign
Thanks for the example, DragonFlyEye and thanks for the feedback
Nikhil.  I have finally come to terms with needing 2 statements.  In
1.2 (even if it was incomplete) it worked with one statement.  The
features of 1.3 are well worth specifying 2 routes.

Thanks again!



On Aug 31, 2:17 pm, DragonFlyEye  wrote:
> It's not so much wrong as incomplete. Any URL *beginning* with '/
> cooks/' will be handled in the above-quoted fashion. But if it begins
> *and ends* with '/cooks', without another routing statement, you'll
> get the error you're talking about. Have a look at the pre-defined
> routing for pages that's already in your routes.php file:
>
>         Router::connect('/pages', array('controller' => 'pages', 'action' =>
> 'index'));
>         Router::connect('/pages/*', array('controller' => 'pages', 'action'
> => 'display'));
>
> There are two statements - not one - that define how that set of
> subdirectories will be handled.
>
> On Aug 30, 6:20 pm, Nikhil  wrote:
>
> > SacoDesign is right. its not working as expected (or the cook book is
> > wrong)
>
> > - - Here is the same from cookbook 
> > (http://book.cakephp.org/view/46/Routes-Configuration
> > )
>
> > "Another common use for the Router is to define an "alias" for a
> > controller. Let's say that instead of accessing our regular URL at /
> > users/someAction/5, we'd like to be able to access it by /cooks/
> > someAction/5. The following route easily takes care of that:
> > Plain Text View
>
> > Router::connect(
> >     '/cooks/:action/*', array('controller' => 'users', 'action' =>
> > 'index')
> > );
>
> > This is telling the Router that any url beginning with /cooks/ should
> > be sent to the users controller. "
>
> > It works fine except if there is no action specified that is the
> > situation in which cake should default to index() function
>
> > /cooks/action1 maps to users->action1()
> > /cooks/action2 maps to users->action2()
> > /cooks/index maps to users->index()
>
> > *BUT*
>
> > /cooks shows a CooksController missing error message
>
> > On Aug 25, 6:05 pm, SacoDesign  wrote:
>
> > > Hello,
>
> > > I'm upgrading my app from 1.2 to 1.3.  I have several custom routes
> > > setup like so:
> > > Router::connect('/blog/:action/*',
> > > array('controller'=>'news_articles', 'action'=>'index'));
>
> > > This works fine, except for when the url is only /blog/.  In that case
> > > I get a "cannot find blog controller" error.  Is this by design, or a
> > > bug?
>
> > > I can get it working by adding another route for:
>
> > > Router::connect('/blog', array('controller'=>'news_articles',
> > > 'action'=>'index'));
>
> > > but that seems wrong.
>
> > > Thanks,
>
> > > -Kevin Wentworth
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Router::connect() not behaving as expected in 1.3?

2010-08-26 Thread SacoDesign
Thanks for the response.  I still cannot get the entire directory to
respond as a controller without 2 router::connect() calls.  I removed
the 'action'=>'index' as suggested.

Has anyone else experienced this issue?  I removed every route from my
routes.php and tried the following:

Router::connect('/blog*', array('controller'=>'news_articles'));
= missing 'BlogController' error; doesn't work for any request
starting with /blog/

Router::connect('/blog/*', array('controller'=>'news_articles'));
= /blog/ -> shows index (working)
= /blog/view/1/ -> shows index; should show view()

Router::connect('/blog/:action/*',
array('controller'=>'news_articles'));
= /blog/ -> missing 'BlogController' error
= /blog/view/1/ -> working



On Aug 25, 1:46 pm, DragonFlyEye  wrote:
> That all looks correct, and it would be the same in 1.2. You might
> write the following, though:
>
> Router::connect('/blog*', array('controller' => 'news_articles'));
>
> That would push all requests for the /blog directory to the right
> controller, then you can create the actions you want and they'll get
> filled in automatically since you didn't specify a pseudo-route for
> each one (which might get complicated).
>
> Cricket's right, though: by putting the pseudo route :action in there
> and then assigning the action 'index,' you're basically pushing every
> single request with a second (but no third) subdirectory in the URL to
> the same action. Seems like it's a bit inefficient?
>
> On Aug 25, 9:05 am, SacoDesign  wrote:
>
> > Hello,
>
> > I'm upgrading my app from 1.2 to 1.3.  I have several custom routes
> > setup like so:
> >Router::connect('/blog/:action/*',
> > array('controller'=>'news_articles', 'action'=>'index'));
>
> > This works fine, except for when the url is only /blog/.  In that case
> > I get a "cannot find blog controller" error.  Is this by design, or a
> > bug?
>
> > I can get it working by adding another route for:
>
> >Router::connect('/blog', array('controller'=>'news_articles',
> > 'action'=>'index'));
>
> > but that seems wrong.
>
> > Thanks,
>
> > -Kevin Wentworth
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Router::connect() not behaving as expected in 1.3?

2010-08-25 Thread SacoDesign
I expected that /blog/ would route to the news_articles controller
(index action) like a call to /blog/index would do.  This is the way
it worked on 1.2.  Now, on 1.3, a request for /blog/ looks for the
blog controller.

Is there any way to combine the two Router::connect()'s into one?

To answer your question, I believe I am only specifying a default
action if none is provided.




On Aug 25, 1:25 pm, cricket  wrote:
> On Wed, Aug 25, 2010 at 9:05 AM, SacoDesign  wrote:
> > Hello,
>
> > I'm upgrading my app from 1.2 to 1.3.  I have several custom routes
> > setup like so:
> > Router::connect('/blog/:action/*',
> > array('controller'=>'news_articles', 'action'=>'index'));
>
> > This works fine, except for when the url is only /blog/.  In that case
> > I get a "cannot find blog controller" error.  Is this by design, or a
> > bug?
>
> > I can get it working by adding another route for:
>
> > Router::connect('/blog', array('controller'=>'news_articles',
> > 'action'=>'index'));
>
> > but that seems wrong.
>
> It looks correct to me. In the first route, you're saying, "/blog,
> plus something, and maybe something else." Obviously, "/blog" alone
> doesn't match.
>
> But why are you directing all requests to the one action?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Router::connect() not behaving as expected in 1.3?

2010-08-25 Thread SacoDesign
Hello,

I'm upgrading my app from 1.2 to 1.3.  I have several custom routes
setup like so:
Router::connect('/blog/:action/*',
array('controller'=>'news_articles', 'action'=>'index'));

This works fine, except for when the url is only /blog/.  In that case
I get a "cannot find blog controller" error.  Is this by design, or a
bug?

I can get it working by adding another route for:

Router::connect('/blog', array('controller'=>'news_articles',
'action'=>'index'));

but that seems wrong.

Thanks,

-Kevin Wentworth

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How do you hide children using the Tree Helper?

2010-03-24 Thread SacoDesign
Hello,

I'm using find('threaded') and the Tree Helper (http://
bakery.cakephp.org/articles/view/tree-helper-1).

My categories are up to 4 levels deep, but I only want to show the top
parent and it's direct children for my navigation bar.  I'm hoping to
remove the children from the output.  I don't want to "hide" the
children using display: none.

Thank you,

-Kevin

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Translate Behavior and Grouping by Locale

2009-11-20 Thread SacoDesign
Hi,

I've got the translate behavior working.  I'm wondering if there is a
way to return the translated fields indexed by locale?

Thanks in advance.

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.