dpi96151 2017-10-24 00:44
浏览 39
已采纳

CakePHP 3从插件Webroot提供文件

I am under the impression that any files placed in the webroot/ folder of a plugin in CakePHP 3 should be served automagically. However, I have not been able to get a file to be served from that folder...

I have created an example project

https://github.com/CakePHPKitchen/CakePHP-Plugin-Webroot-Issue

In the example project, I have baked a plugin named Elite and inside the plugins/Elite/src/webroot I have placed a text file named bingo.txt

To reproduce the issue

My Question is, how do I retrieve bingo.txt?

Do I have to set a setting somewhere to enable that webroot folder?

  • 写回答

1条回答 默认 最新

  • doulan8054 2017-10-24 01:07
    关注

    Make sure the plugin is loaded in your config/bootstrap.php

    Plugin::load('Elite');
    

    Then link to the webroot of the plugin with localhost:8675/elite/bingo.txt

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率