苏鲁定制捆绑。生产环境中的空页面

时间:2017-04-21 13:51:16

标签: symfony sulu

我使用本课http://blog.sulu.io/how-to-develop-a-bundle-in-the-sulu-admin-1开发了自定义捆绑包。当dev环境打开时,一切正常,但是在prod中我看到一个带有左菜单的空白页面。 Bundle的main.js console.log()没有触发。有人可以帮帮我吗?

enter image description here

路由

//routing_api.xml
<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://friendsofsymfony.github.com/schema/rest"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://friendsofsymfony.github.com/schema/rest https://raw.github.com/FriendsOfSymfony/FOSRestBundle/master/Resources/config/schema/routing/rest_routing-1.0.xsd">
    <import id="dates" resource="Example\NewsBundle\Controller\CalendarDateController" type="rest"/>
    <import id="emails" resource="Example\NewsBundle\Controller\CalendarEmailController" type="rest"/>
    <import id="letters" resource="Example\NewsBundle\Controller\CalendarLetterController" type="rest"/>
    <import id="reserves" resource="Example\NewsBundle\Controller\CalendarReserveController" type="rest"/>
</routes>

管理员班级

//admin class
<?php

namespace Example\NewsBundle\Admin;

use Sulu\Bundle\AdminBundle\Admin\Admin;
use Sulu\Bundle\AdminBundle\Navigation\Navigation;
use Sulu\Bundle\AdminBundle\Navigation\NavigationItem;

class CalendarDateAdmin extends Admin
{
    public function __construct($title)
    {
        $rootNavigationItem = new NavigationItem($title);

        $global = new NavigationItem('navigation.modules', $rootNavigationItem);
        $news = new NavigationItem('navigation.news', $global);
        $news->setAction('example/dates');
        $news->setIcon('pencil-square-o');
        $news->setPosition(25);

        $datesPageItem = new NavigationItem('navigation.news.dates');
        $datesPageItem->setAction('example/dates');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.emails');
        $datesPageItem->setAction('example/emails');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.letters');
        $datesPageItem->setAction('example/letters');
        $news->addChild($datesPageItem);

        $datesPageItem = new NavigationItem('navigation.news.reserves');
        $datesPageItem->setAction('example/reserves');
        $news->addChild($datesPageItem);

        $this->setNavigation(new Navigation($rootNavigationItem));
    }

    public function getJsBundleName()
    {
        return 'examplenews';
    }
}

0 个答案:

没有答案
相关问题