Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Layout links prefixed with plugin name when viewing plugin action
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
benr  
View profile   Translate to Translated (View Original)
 More options 4 Nov, 17:09
From: benr <benrasmu...@gmail.com>
Date: Wed, 4 Nov 2009 09:09:34 -0800 (PST)
Local: Wed 4 Nov 2009 17:09
Subject: Layout links prefixed with plugin name when viewing plugin action
I have a plugin to handle a portion of my application. The plugin
renders a view, but uses my default layout. The problem is that all my
links in the layout (which don't have anything to do with the plugin)
all get the plugin name prefixed to them. For example:

Regular link: http://domain.com/regularlink
In plugin view: http://domain.com/plugin_name/regularlink

I'm using $html->link() to create all my links and I know that you can
add 'plugin' => null to disable that routing behavior but it seems a
bit counter-intuitive to have to do that with every non-plugin link in
a layout just so you can use plugins.

Is there a way to set the baseUrl or somehow remove that prefix form
all links unless they explicitly have the 'plugin' => 'plugin_name'
key/value in the url array()?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert P  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 03:49
From: Robert P <shiftyrobs...@gmail.com>
Date: Wed, 4 Nov 2009 19:49:17 -0800 (PST)
Local: Thurs 5 Nov 2009 03:49
Subject: Re: Layout links prefixed with plugin name when viewing plugin action
This seems to be an issue traceable back to Router::url(). A possible
solution would be to extend the View class to override the renderLayout
() method.

The new renderLayout() would be something like:
    get Router instance
    remove plugin references
    parent::renderLayout()

I would be interested in hearing if this works.

On Nov 5, 1:09 am, benr <benrasmu...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
benr  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 15:44
From: benr <benrasmu...@gmail.com>
Date: Thu, 5 Nov 2009 07:44:22 -0800 (PST)
Local: Thurs 5 Nov 2009 15:44
Subject: Re: Layout links prefixed with plugin name when viewing plugin action
Thanks for the suggestion! We ended up taking a similar approach by
extending the HtmlHelper::url() function in the app_helper.php (based
on this article:
http://debuggable.com/posts/how-to-save-half-a-second-on-every-reques...

<?php
// app_helper.php
class AppHelper extends Helper {

  function url($url = null, $full = false) {

 if( !isset($url['plugin']) ){
  $url['plugin'] = null;
 }

    return parent::url($url, $full);
  }
  

}

?>

Now you just have to make sure that any plugin URLs have the plugin
explicitly defined in the url array ('plugin' => 'plugin_name'), but
all other links will have 'plugin' => null set by default.

On Nov 4, 8:49 pm, Robert P <shiftyrobs...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google