[symfony-users] Re: recursive redirect :-/

2010-06-03 Thread comb
Thanks, I solved it with the users session: // redirect to referrer if not in this action here if ($this-getUser()-getAttribute('in_search', false)) { $this-getUser()-setAttribute('in_search', false); $this-redirect('@homepage'); } else { $ref = $request-getReferer();

[symfony-users] Re: recursive redirect :-/

2010-06-03 Thread pghoratiu
You should store in the session the timestamp of the last request so you can decide when to do the redirect for the user. gabriel On Jun 3, 12:44 pm, comb sa...@gmx.net wrote: Thanks, I solved it with the users session: // redirect to referrer if not in this action here if

[symfony-users] Re: recursive redirect :-/

2010-06-03 Thread comb
yes, I already save the timestamp, but in this thread the topic only was the redirect-problem. That's solved with my last post! :-) Thanks everybody! On 3 Jun., 12:52, pghoratiu pghora...@gmail.com wrote: You should store in the session the timestamp of the last request so you can decide when

[symfony-users] Re: recursive redirect :-/

2010-06-02 Thread comb
yeah but how can I check if the current page is the same as the user comes from? On 2 Jun., 21:20, Eno symb...@gmail.com wrote: On Wed, 2 Jun 2010, comb wrote: In a executeIndex(...) I want to redirect to the referrer, but only if the referrer is not the current action. How can I do that?

[symfony-users] Re: recursive redirect :-/

2010-06-02 Thread pghoratiu
You need to evaluate your routes into a module/action tuple, see the last example on this page: http://pookey.co.uk/wordpress/archives/80-playing-with-symfony-routing-without-symfony You can probably load the routes separately from the YAML as well. gabriel On Jun 3, 12:24 am, comb

[symfony-users] Re: recursive redirect :-/

2010-06-02 Thread comb
Thank you pghoratiu, that furthers me, but I still wonder about that and cannot get it to work: routing.yml: search_query: url: /search/q param: { module: search, action: search } public function executeSearch(sfWebRequest $request) { var_dump($this-getRoute()-getPattern()); $ref =

Re: [symfony-users] Re: recursive redirect :-/

2010-06-02 Thread Eno
On Wed, 2 Jun 2010, comb wrote: Output: string '/search/q' (length=9) string 'http://localhost:8047/frontend_dev.php/search/q' (length=47) boolean false But I would expect the $is_recursive to be true?! How can I evaluate if the current route is the same as the referrer comes from? :-/

[symfony-users] Re: recursive redirect :-/

2010-06-02 Thread comb
I have a search-form which is included in almost every page. If a users searches to often (flooding) he gets a message (user-flash) to wait some time. In this case, I want to redirect the user back to the page he came from when he starts the search. (if there is no referrer, the user gets

Re: [symfony-users] Re: recursive redirect :-/

2010-06-02 Thread Eno
On Wed, 2 Jun 2010, comb wrote: But now there is a search-results page, too, that comes from the search-action, where the redirection is done. If the user starts a new search from here and is too fast he gets the flash-message again, but the redirect to the last page is recursively since he