Yes, I was thinking about that as well

class My_View_Helper_Url extends Zend_View_Helper_Url
{

 public function url(array $urlOptions = array(), $name = 'default', $reset
= false, $encode = true)
 {
   return parent::url($urlOptions,$name,
$reset,$encode);
 }
}


Regards,
Saša Stamenković


On Sun, Dec 13, 2009 at 1:12 PM, Alayn Gortazar <[email protected]> wrote:

> You can extend the Url Helper to override it's behaviour.
> Something like:
>
> class My_View_Helper_Url extends Zend_View_Helper_Url
> {
>
>  public function url(array $urlOptions = array(), $name = null, $reset =
> false, $encode = true)
>  {
>    if(is_null($name)
>    {
>      $name = 'default';
>    }
>    return parent::url($urlOptions,$name,$reset,$encode);
>  }
> }
> --
> Alayn Gortazar
>
> ----- "umpirsky" <[email protected]> escribió:
>
> > Naah, I expected default route to be used. is there a waz around this.
> > It's a
> > drag to change null to default on all places :(
> >
> >
> > Alayn Gortazar wrote:
> > >
> > > Hi Saša,
> > >
> > > ----- "umpirsky" <[email protected]> escribió:
> > >
> > >> Ah, now I see where the problem is. Must watch traces better:
> > >>
> > >
> > > Not so easy to trace/understand them sometimes, hehe.
> > >
> > >> So, in my quick search firm, which is rendered on that page, i
> > have:
> > >>
> > >> $this->getView()->url(array('controller' => 'search','action' =>
> > >> 'result'),
> > >> null, true)
> > >
> > > I suppose you already changed this, but just in case...
> > > Change the 'null' parameter with "default" value. That should do
> > it... :)
> > >
> > >> and it tries to use same route, why? Why does it not use the
> > default
> > >> route?
> > >
> > > Look at the $name parameter description...
> > >
> > >
> >
> http://framework.zend.com/apidoc/core/Zend_View/Helper/Zend_View_Helper_Url.html
> >
> > > -----------------------
> > >  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
> > > -----------------------
> > >
> > > Cheers,
> > >
> > > --
> > > Alayn Gortazar
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://n4.nabble.com/Adding-simple-route-in-application-ini-tp961683p962924.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to