English 中文(简体)
缩略语2.0 KnpMenu习俗模板
原标题:Symfony 2.0 KnpMenu custom template

试图从knpMenu修改模板。 我改名为knp_main_menu.html.twig

<>strong>config.yml:

knp_menu:
    twig:
        template: knp_main_menu.html.twig
    templating: true
    default_renderer: twig

knp_menu.html.twig 但我的档案(原件的复印件)没有。 是否有办法这样做?

我的最终目标是制作模版,以标语开展工作:

例如:

$menu->addChild( Grupy , array(
             route  =>  group ,
             attributes  => array(
                 title  =>  Dodaj nową grupę ,
                 data-icon  =>  group ,
                 data-id  =>  groups_list ,
            )
        ));

提出这样的建议:

<ul>
    <li title="Dodaj nową grupę" data-id="groups_list" data-icon="group">
        <a href="...">
            <img src="somedir/group.png" /> Grupy 
        </a>
    </li>
</ul>
最佳回答

这非常简单:

{{ knp_menu_render( AlefDemoBundle:Builder:mainMenu , {  template :  AlefDemoBundle:Menu:knp_main_menu.html.twig  }) }}

外部模板。

问题回答

暂无回答




相关问题
C#和Lotus Notes附录一

我正在使用C#,并需要附上一张空白(shortcut/link)档案和电子邮件给一个彩票账户。 问题是一对一幅通用形象的不实之词,没有像......那样显示双fold。

Load the Default Icon For the Shell

The default icon in Vista is listed under: HKEY_CLASSES_ROOT Unknown DefaultIcon As: %SystemRoot%System32shell32.dll,0 I want to load a 48x48 version of that Icon in C++. I have tried: ...

How to access Google/Gmail/Gchat/Reader user icons

I m building a Google Reader client and wonder if it s possible to access a user s profile image (aka avatar) directly. When I navigate to the images in Reader itself, I find that they point to URLs ...

How to tell Windows Explorer to refresh its icons?

Once my installer finishes installing new versions of my application s exe, I d like to tell Explorer to use the new exe s icons for its shortcuts. However, I cannot figure out how to do this. From ...

Outlook 2003 - Add an icon column to a View?

I want to add a custom column to the Inbox which is a Yes/No column. I want an icon to show in the Yes case. How can I do this? Everything I ve looked up is either about adding a column through the ...

热门标签