New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

01: Introduction Sulu-Admin-class #1

Open
wants to merge 2 commits into
base: 00-symfony-bundle
from
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+32 −6
Diff settings

Always

Just for now

Copy path View file
@@ -0,0 +1,28 @@
<?php
namespace Example\NewsBundle\Admin;
use Sulu\Bundle\AdminBundle\Admin\Admin;
use Sulu\Bundle\AdminBundle\Navigation\Navigation;
use Sulu\Bundle\AdminBundle\Navigation\NavigationItem;
class NewsAdmin extends Admin

This comment has been minimized.

@wachterjohannes

wachterjohannes Jan 15, 2016

Member

Registers the bundle in the Sulu-Admin

{
public function __construct($title)
{
$rootNavigationItem = new NavigationItem($title);
$section = new NavigationItem('navigation.webspaces');
$global = new NavigationItem('navigation.global-content');
$section->addChild($global);
$news = new NavigationItem('navigation.news');
$news->setAction('example/news');

This comment has been minimized.

@wachterjohannes

wachterjohannes Jan 15, 2016

Member

The action will be used by the JavaScript application to determine which component should be loaded to display the content for that page.

$global->addChild($news);
$rootNavigationItem->addChild($section);
$this->setNavigation(new Navigation($rootNavigationItem));
}
}
Copy path View file
@@ -4,13 +4,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<!--
<services>
<service id="example_news.example" class="Example\NewsBundle\Example">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
<service id="example_news.admin" class="Example\NewsBundle\Admin\NewsAdmin">
<argument>%sulu_admin.name%</argument>

<tag name="sulu.admin"/>

This comment has been minimized.

@wachterjohannes

wachterjohannes Jan 15, 2016

Member

This tag will be used by the SuluAdminBundle to find all Bundles

</service>
</services>
-->
</container>
ProTip! Use n and p to navigate between commits in a pull request.