dtgr3392 2012-08-14 12:53
浏览 48
已采纳

从插件调用helper-> url时,Croogo翻译路径不匹配

I'm using Croogo 1.3.4 with Translate plugin. The url of my nodes look like: fra/page/my-slug-for-page

When I access the page fra/page/my-slug-for-page , the Html->image method (invoking app_helper->url) is rendering following link: http://www.mysite.com/fra/page/my-slug-for-page

This is perfectly working.

However, when I'm rendering the same themed layout, in a plugin named myplugin, the Html->image method is rendering http://www.mysite.com/myplugin/page/my-slug-for-page/locale:fra

I traced into the Router:url method, and it appears that no route match, especially not this one that match in other cases.

Router::connect('/:locale/:controller/:action/*', array(), array('locale' => '[a-z]{3}'));

Image link is displayed like this:

<?php echo $html->image('/img.png',array('url' => array('locale'=>'fra', 'controller'=> 'page', 'action'=>'my-page-slug')));?>
  • 写回答

1条回答 默认 最新

  • doushang2021 2012-08-14 12:53
    关注

    I found that the problem was in plugin name that should be specified, even if empty. Croogo it self feed the plugin name with the current plugin name.

    <?php echo $html->image('/img.png',array('url' => array('locale'=>'fra', 'controller'=> 'page', 'action'=>'my-page-slug', 'plugin'=>'')));?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?