Create a menu item in backend
Steps to create a menu item:
src\MisBundle\Resources\config\oro\navigation.yml
navigation:
menu_config:
items:
scicom_tab:
label: Scicom
uri: '#'
extras:
position: 300
scicom_tab_link:
label: Scicom Hello
route: scicom_link
tree:
application_menu:
children:
scicom_tab:
children:
scicom_tab_link: ~
titles:
scicom_link: Hello
src\MisBundle\Resources\config\oro\routing.yml
mis_bundle:
resource: "@MisBundle/Controller"
type: annotation
prefix: /mis
Remove file src\config\routing.yml or comment out the auto-generate lines from CLI php bin/console generate:bundle
src\MisBundle\Controller\DefaultController.php
<?php
namespace MisBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends Controller
{
/**
* @Route("/hello", name="scicom_link")
* @Template()
*/
public function indexAction()
{
return array('name' => "John Doe");
}
}
src\MisBundle\Resources\views\Default\index.html.twig
{% extends "OroUIBundle:Default:index.html.twig" %}
{% block content %}
<h1>Hello, {{ name }}!</h1>
{% endblock content %}
Refresh Cache
kiat@win10 MINGW64 /d/Work/wamp64/www/oro/platform-application (master)
$ php bin/console cache:clear
// Clearing the cache for the dev environment with debug
// true
[OK] Cache for the "dev" environment (debug=true) was successfully cleared.