Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF]Definicja nazwy parametrów w XMLu dla Zend_Controller_Router_Route_Regex, jak to zrobic?
mrok
post 17.11.2010, 15:23:30
Post #1





Grupa: Zarejestrowani
Postów: 258
Pomógł: 17
Dołączył: 22.05.2007

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


Mam taki router definiowany w xmlu

  1.  
  2. <paramtest>
  3. <route>paramtest/([a-zA-Z0-9_-]*),([\d]*)</route>
  4. <defaults>
  5. <module>default</module>
  6. <controller>index</controller>
  7. <action>param</action>
  8. </defaults>
  9. <map>
  10. <p1>p1</p1>
  11. <p2>p2</p2>
  12. </map>
  13. <reverse>paramtest/%s,%d</reverse>
  14. </paramtest>


gdy wywołam

Cytat


to kod jak poniżej


  1. public function paramAction()
  2. {
  3. Zend_Debug::dump($this->_getAllParams());
  4. die;
  5. }



zwraca

  1. 1 => string 'dsfsdf' (length=6)
  2. 2 => string '2' (length=1)
  3. 'module' => string 'default' (length=7)
  4. 'controller' => string 'index' (length=5)
  5. 'action' => string 'param' (length=5)


ale chciałbym coś takiego

  1. p1 => string 'dsfsdf' (length=6)
  2. p2 => string '2' (length=1)
  3. 'module' => string 'Default' (length=7)
  4. 'controller' => string 'index' (length=5)
  5. 'action' => string 'param' (length=5)


jak moge to zdefiniowac?questionmark.gif

Ten post edytował mrok 17.11.2010, 16:23:52


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 04:12