Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework]Problem z routingiem
MaciekPierwszy
post
Post #1





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 8.02.2013

Ostrzeżenie: (0%)
-----


Witam

Dodałem sobie parametr języka w bootstrapie w następujący sposób

  1. $router->addRoute(
  2. 'lang',
  3. new Zend_Controller_Router_Route('/:lang/',
  4. array('lang' => ':lang')
  5. )
  6. );


Niestety z jakis nieznanych mi powodow nie wypisuje mi wtedy action w formularzach a robie to tak
  1. $url = $view->url(array(
  2. 'controller' => 'auth', 'action' => 'register'
  3. ));
  4. $this->setAction($url);


dlaczego tak się dzieje??
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
irmidjusz
post
Post #2





Grupa: Zarejestrowani
Postów: 279
Pomógł: 60
Dołączył: 25.02.2012

Ostrzeżenie: (0%)
-----


otwierasz dokumentację Zend_View_Helper_url i czytasz:

Generates an url given the name of a route.

return: Url for the link href attribute.
access: public

string url ([ $urlOptions = array()], [mixed $name = null], [bool $reset = false], [ $encode = true])

array $urlOptions: Options passed to the assemble method of the Route object.
mixed $name: The name of a Route to use. If null it will use the current Route
bool $reset: Whether or not to reset the route defaults with those provided
$encode


podpowiedź: drugi parametr to nazwa route
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 28.12.2025 - 21:16