我想知道如何从浏览器查询或控制器运行Symfony 2命令.
因为我没有任何可能在托管运行它,每个cron作业都由管理员设置.
我甚至没有启用exec()功能所以当我想测试它时,我必须将命令中的所有内容复制到某个测试控制器,这不是最佳解决方案.
我有一个关于symfony2和bootstrap的问题.我不明白为什么我可以从环境"prod"加载图标图像,但不能从环境"dev"加载.在开发中,我收到此错误.
路线是"GET /img/glyphicons-halflings.png".
Image web/img/glyphicons-halflings.png是../../vendor/twitter/bootstrap/img/glyphicons-halflings.png的符号链接
我得到这个错误
http://my.web.site/app_dev.php/img/glyphicons-halflings.png
Run Code Online (Sandbox Code Playgroud)
并获得图像
http://my.web.site/img/glyphicons-halflings.png
Run Code Online (Sandbox Code Playgroud)
UPDATE
我以这种方式包含bootstrap:
{% stylesheets '%kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less' %}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}" />
{% endstylesheets %}
Run Code Online (Sandbox Code Playgroud)
当我在prod使用时,这是有效的
<span class="icon-edit"></span>
Run Code Online (Sandbox Code Playgroud)
我有这个资产配置:
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ MyAwesomeBundle ]
filters:
lessphp:
file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
apply_to: "\.less$"
Run Code Online (Sandbox Code Playgroud)
我也试过创建我的收藏:
assetic:
assets:
senso:
inputs:
- '../img/glyphicons-halflings.png'
outputs:
- 'img/glyphicons-halflings.png'
filters:
- ?lessphp
Run Code Online (Sandbox Code Playgroud)
:dump create web/assetic/senso.png和web/assetic/senso_glyphicons-halflings.png但是,...如何使用senso*.png图像?