Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZF] Zend_Controller_Router_Route_Regex - zastosowanie 4go parametru
a79rtur
post 6.04.2008, 21:04:38
Post #1





Grupa: Zarejestrowani
Postów: 331
Pomógł: 1
Dołączył: 23.05.2004
Skąd: Tarnów/Londyn

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


wycinek z manuala :

Cytat
Since regex patterns are not easily reversed, you will need to prepare a reverse URL if you wish to use a URL helper or even an assemble method of this class. This reversed path is represented by a string parsable by sprintf() and is defined as a fourth construct parameter:


  1. <?php
  2. $route = new Zend_Controller_Router_Route_Regex(
  3. 'archive/(d+)',
  4. array( ... ),
  5. array('year' => 1),
  6. 'archive/%s'
  7. );
  8. ?>


rozumiem ogolne zastosowanie tej klasy, ale nie bardzo wiem o co chodzi z 4tym parametrem, czy mógłby ktoś wyjaśnić na przykładzie

Ten post edytował a79rtur 6.04.2008, 21:05:48


--------------------
php 5.1.2 & Apache 2.0.50 & MySQL 4.1.7 @ WinXP Pro
..:: GG 6449856 ::..
www.londyn.me.uk - ogłoszenia mieszkaniowe dla Londynu
Go to the top of the page
+Quote Post
LBO
post 7.04.2008, 08:06:15
Post #2





Grupa: Zarejestrowani
Postów: 1 415
Pomógł: 117
Dołączył: 7.09.2005
Skąd: Warszawa

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


Zend nie radzi sobie z tworzeniem ścieżek z podanych wyrażeń regularnych (nie jest to przyjemne) - trzeba mu pomóc i tyle.

  1. <?php
  2. sprinft("archive/%s", 4); // "archive/4"
  3. ?>


Ten post edytował LBO 7.04.2008, 08:06:32
Go to the top of the page
+Quote Post

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.06.2025 - 23:48