我想在我的树枝来加载图像,但它不显示任何东西只显示图片ALT负荷图像
这是我list.html.twig将加载图像:
<img src="{{ asset('images/2.jpg') }}" alt="Symfony" />
,这是我的控制器:
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class InheritanceController extends Controller
{
/**
* @Route("/inherit")
*/
public function inheritAction(){
return new Response($this->render('article/list.html.twig'));
}
}
我的图像文件夹在根目录
你是什么意思的根目录?你能展示或描述你的文件架构吗? –
@ t-n-y在symfony中的根目录 – sepehr