douwen3836 2016-07-09 10:30
浏览 46

Symfony2命令行生成全局文件夹下的树枝模板(扩展)

As related to a previous question i asked, and got an answer to, i'm posting this question to further enhance the usability of the answer, the question was how to automatically generate the twig templates under the global folder app/Resources/views/home/home.html.twig while using php app/console generate:controller command. i got a workable answer to this, which is entering the path to the global app folder like so

Templatename (optional) [AppBundle:Post:get.html.twig]: ::../../../../app/Resources/views/Post/get.html.twig

The thing is the generated template still has the {% extends "::base.html.twig" %} clause with double colon for the AppBundle location, and also typing out the long sting path with the ../../.. would be too painful to do repeatedly.

Im pondering if there is a solution to actually override the console command itself to accommodate this? symfony 3 automatically generates base templates under the global folder and the best practice for symfony 2 is to have templates inside the global folder, i don;t know why the creators have not updated this.

There will be a bounty for quality answers on this question a friend has agreed to do so since i do not have enough reputation.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度