所有網頁 圖片 影片 地圖 新聞 網誌搜尋 Gmail 更多 »
最近造訪的群組 | 說明 | 登入
Google 網上論壇首頁
Layout links prefixed with plugin name when viewing plugin action
目前本群組有太多主題設為優先顯示。要優先顯示這個主題,請將其他主題的這個選項取消。
在處理您的要求時發生錯誤。請再試一次。
標幟
  3 個訊息 - 全部摺疊  -  將全文翻譯為 已翻譯 (查看所有原文)
您要留言的群組是 Usenet 群組。在此群組留言,網際網路上的任何使用者將可以看到您的電郵地址。
您的回覆郵件尚未寄出。
您已成功留言
 
寄件人:
收件人:
副本:
後續追蹤對象:
新增副本 | 新增後續追蹤對象 | 編輯主旨
主旨:
驗證:
為了確認,請輸入您在以下圖片中看到的字元,或輸入您按下存取圖示時所聽到的號碼。 注意聽並輸入您聽到的號碼
 
benr  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月5日, 上午1時09分
寄件人: benr <benrasmu...@gmail.com>
日期: Wed, 4 Nov 2009 09:09:34 -0800 (PST)
當地時間: 2009年11月5日(星期四) 上午1時09分
主旨: 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()?


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
Robert P  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月5日, 上午11時49分
寄件人: Robert P <shiftyrobs...@gmail.com>
日期: Wed, 4 Nov 2009 19:49:17 -0800 (PST)
當地時間: 2009年11月5日(星期四) 上午11時49分
主旨: 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:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
benr  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月5日, 下午11時44分
寄件人: benr <benrasmu...@gmail.com>
日期: Thu, 5 Nov 2009 07:44:22 -0800 (PST)
當地時間: 2009年11月5日(星期四) 下午11時44分
主旨: 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:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
無其他留言
« 返回討論主題 « 較新的主題     較舊的主題 »

建立群組 - Google 網上論壇 - Google 首頁 - 服務條款 - 隱私權政策
©2009 Google