On 5 Paź, 03:31, rchavik <[email protected]> wrote:
> You could create a custom helper inheriting HtmlHelper, then use the 
> joeb'sAnalogue plugin<https://github.com/joebeeson/analogue>to masquerade 
> your helper as core HtmlHelper. This way, you don't have to
> modify your view files

Thanks... that got me thinking so I dug into the whole thing and I
found out the solution... Long story short - I overrode Router's url()
method and set it to explicitly set 'admin'=>false for urls in
prefixed routes...

Here's the code that goes into app_helper.php:

class AppHelper extends Helper {

  function url($url = null, $full = false) {
     if(isset($this->params['prefix'])){
        $prefix = $this->params['prefix'];

        if($this->params[$prefix] && (!isset($url[$prefix]) || !
$url[$prefix])){
           $url[$prefix] = false;
        }
     }
     return parent::url($url, $full);
  }
}

So far it works like a charm... we'll see how it goes...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to