Hi,

I've created a routing system with the language code in the URL. For
example, http://myurl/en/contact give me the contact page in english
and http://myurl/fr/contact give it to me in french.

I've created a filter to check if the language in the URL exists and
can be treated. $codes is an array with the list of accepted
languages. $this->getContext()->getUser()->getCulture() returns the
language code in the URL (actually the first parameter of the URL).
Here is my filter:

<?php
class cultureFilter extends sfFilter
{
  public function execute($filterChain)
  {
        ...

        if (!in_array($this->getContext()->getUser()->getCulture(), $codes))
{
                $this->getContext()->getUser()->setCulture('en');
                // I want to produce a 404 here !
        }

        $filterChain->execute();
  }
}

The problem is when I type something like http://myurl/dqsdhjdssqd/contact,
it works and it gives me the contact page in english. I would rather
have a 404 error (forward to my own 404 page). How is it possible?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to