|
List Info
Thread: Wildcards routes and reset parameter
|
|
| Wildcards routes and reset parameter |

|
2007-03-21 09:01:21 |
Hi,
I have created a route this way:
$router = new Zend_Controller_Router_Rewrite();
$route = new Zend_Controller_Router_Route('/*',
array('controller'
=> 'index',
'action'
=> 'index'));
$router->addRoute('root', $route);
And the current request uri is something like this:
/key1/value1/key2/value2
Within a view I use the Url helper like this:
echo $this->url(array('key1' => 'newvalue'), 'root');
I thought it should returns something like
"/key1/newvalue" but it returns
something like "/key1/newvalue/key2/value2".
I have tried to add the "reset" parameter to true
but then I don't have any
parameter at all, just "/":
echo $this->url(array('key1' => 'newvalue'), 'root',
true);
Is it a bug or a feature?
If this is a feature, is there a way to assemble a wildcard
route without
taking into account the current parameters?
--
Olivier
|
|
| Re: Wildcards routes and reset
parameter |

|
2007-03-21 10:54:16 |
Hi Olivier,
i stumbled across the same issue.
My workarond was to build my own route class which modifies
the assemble
method.
Now if reset is true assemble takes account of my given
parameters but
resets the request parameters..
Hope that helps
Bye
Jens
Olivier Sirven schrieb:
> Hi,
>
> I have created a route this way:
> $router = new Zend_Controller_Router_Rewrite();
> $route = new Zend_Controller_Router_Route('/*',
>
array('controller' => 'index',
>
'action' => 'index'));
> $router->addRoute('root', $route);
> And the current request uri is something like this:
> /key1/value1/key2/value2
>
> Within a view I use the Url helper like this:
> echo $this->url(array('key1' => 'newvalue'),
'root');
>
> I thought it should returns something like
"/key1/newvalue" but it returns
> something like "/key1/newvalue/key2/value2".
> I have tried to add the "reset" parameter to
true but then I don't have any
> parameter at all, just "/":
> echo $this->url(array('key1' => 'newvalue'),
'root', true);
>
> Is it a bug or a feature?
> If this is a feature, is there a way to assemble a
wildcard route without
> taking into account the current parameters?
>
>
|
|
|
| Re: Wildcards routes and reset
parameter |

|
2007-03-21 11:14:49 |
Hi,
I did the same...but I have to say it sounds strange to me
to have to write
another assemble method to manage something supposed to work
out of the
box...maybe there is a good reason for this behaviour but I
really don't get
it ;)
Olivier
Le mercredi 21 mars 2007, Jens Wabnitz a écrit :
> Hi Olivier,
>
> i stumbled across the same issue.
> My workarond was to build my own route class which
modifies the assemble
> method.
> Now if reset is true assemble takes account of my given
parameters but
> resets the request parameters..
|
|
| CRUD Applications |

|
2007-03-21 12:37:01 |
|
|
Hi again,
I would like to start a simple CRUD application.
Does anybody know where I can learn the
basics?
Best Regards,
José de Menezes |
| Re: CRUD Applications |

|
2007-03-21 13:08:31 |
-- José de Menezes Soares Neto <ze detetive.net> wrote
(on Wednesday, 21 March 2007, 02:37 PM -0300):
> I would like to start a simple CRUD application.
>
> Does anybody know where I can learn the basics?
I gave a presentation at BostonPHP a couple weeks ago, and
posted my
slides online:
http://weierophinney.net/mat
thew/archives/137-BostonPHP-Framework-Presentations.html
It goes through a sample CRUD application.
--
Matthew Weier O'Phinney
PHP Developer | matthew zend.com
Zend - The PHP Company | http://www.zend.com/
|
|
| Re: Wildcards routes and reset
parameter |

|
2007-03-22 06:57:30 |
Olivier Sirven wrote:
(...)
> I have tried to add the "reset" parameter to
true but then I don't have any
> parameter at all, just "/":
> echo $this->url(array('key1' => 'newvalue'),
'root', true);
>
> Is it a bug or a feature?
It's more a bug than a feature. Fixed with commit 4715. Good
catch, thanks
> If this is a feature, is there a way to assemble a
wildcard route without
> taking into account the current parameters?
There is another way to reset parameters. You can leave
$reset as false but
pass 'var' => null to assemble if you wish to reset
specific url variables only.
--
Martel Valgoerad aka Michal Minicki | martel aie.pl |
http://aie.pl/martel.asc
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=
"Idleness is not doing nothing. Idleness is being free
to do anything." --
Floyd Dell
|
|
| Re: CRUD Applications |

|
2007-03-23 15:13:18 |
Matthew Weier O'Phinney a écrit :
> -- José de Menezes Soares Neto <ze detetive.net> wrote
> (on Wednesday, 21 March 2007, 02:37 PM -0300):
>
>> I would like to start a simple CRUD application.
>>
>> Does anybody know where I can learn the basics?
>>
>
> I gave a presentation at BostonPHP a couple weeks ago,
and posted my
> slides online:
>
> http://weierophinney.net/mat
thew/archives/137-BostonPHP-Framework-Presentations.html
>
> It goes through a sample CRUD application.
>
>
Thanks Matthew,
Would it be possible to download the source code somewhere ?
--
Laurent Melmoux, laurent 2mx.fr
Annecy - France
|
|
| Re: CRUD Applications |

|
2007-03-23 15:38:01 |
-- Laurent Melmoux <laurent 2mx.fr> wrote
(on Friday, 23 March 2007, 09:13 PM +0100):
> Matthew Weier O'Phinney a écrit :
> > -- José de Menezes Soares Neto <ze detetive.net> wrote
> > (on Wednesday, 21 March 2007, 02:37 PM -0300):
> >
> > > I would like to start a simple CRUD
application.
> > >
> > > Does anybody know where I can learn the
basics?
> > >
> >
> > I gave a presentation at BostonPHP a couple weeks
ago, and posted my
> > slides online:
> >
> > http://weierophinney.net/mat
thew/archives/137-BostonPHP-Framework-Presentations.html
> >
> > It goes through a sample CRUD application.
> >
> >
> Thanks Matthew,
>
> Would it be possible to download the source code
somewhere ?
Not yet. I need to refactor the table class to work with the
current
Zend_Db_Table code; currently it will only work with
pre-0.8.0.
Also, there are some things I did in the presentation
regarding the MVC
that have now moved into core -- in particular, the render()
method.
Basically, I need to re-do the presentation materials,
which, due to my
work load, isn't going to happen too soon. Once I do, I'll
update my
blog again.
--
Matthew Weier O'Phinney
PHP Developer | matthew zend.com
Zend - The PHP Company | http://www.zend.com/
|
|
[1-8]
|
|