url - Mixing Named params with standard params Phalcon -
i have url loads fonts such:
/templatename/fonts/helvetica?weights=regular,bold,light
in php dynamically generate css file appropriate font referencing.
we moved on to phalcon , broke. i'm trying figure out how tell router use the font name named param use standard param style. question marks.
this router looks right now:
... "fonts"=>[ "pattern" => "/fonts/{file:[\w\w]}", "route" => [ "controller" => "asset", "action" => "fonts" ] ] ...
when use dispatcher loop, this:
$params = $this->dispatcher->getparams()
the array not show weights param:
array ( [template] => templatename [file] => helvetica )
how can without changing url structure?
array ( [template] => templatename [file] => helvetica [weights] => regular,bold,light )
if have following url:
/templatename/fonts/helvetica?weights=regular,bold,light
then weights=regular,bold,light
parameters.
you can request these inside phalcon using:
$weights = $this->request->getquery('weights')
you not have declare inside routes, phalcon automatically appends these get
parameters end of routes.
check phalcon http request docs more info
Comments
Post a Comment