Commit 27d4bede authored by Mat's avatar Mat

installation FOSjsRoutingBundle ->

* cfr:
https://symfony.com/doc/master/bundles/FOSJsRoutingBundle/installation.html
* composer require friendsofsymfony/jsrouting-bundle
* edit app/AppKernel.php et app/config/routing.yml
* php bin/console assets:install --symlink web (symlink-> option linux)
  !! attention les modifs de assets:install sont dans vendor, il faut
refaire cette commande sur le serveur prod !!
parent f94c77bd
......@@ -20,6 +20,7 @@ class AppKernel extends Kernel
new FOS\UserBundle\FOSUserBundle(),
new APIBundle\APIBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
......
......@@ -5,6 +5,9 @@
<title>{% block title %}Welcome!{% endblock %}</title>
<script src="{{ asset('bundles/fosjsrouting/js/router.min.js') }}"></script>
<script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
{% block stylesheets %}{% endblock %}
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}">
......
......@@ -78,3 +78,8 @@ fos_user:
from_email:
address: "%mailer_user%"
sender_name: "%mailer_user%"
# FOSjsRouting Configuration
fos_js_routing:
routes_to_expose:
- api_legume_*
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
api:
resource: "@APIBundle/Resources/config/routing.yml"
prefix: /API/v1
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c0c183c8512282a4e70611307ee0c98a",
"content-hash": "8327078eb619a89d058b5cd1f6620a89",
"packages": [
{
"name": "composer/ca-bundle",
......@@ -889,6 +889,65 @@
],
"time": "2016-10-17T18:31:11+00:00"
},
{
"name": "friendsofsymfony/jsrouting-bundle",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/FOSJsRoutingBundle.git",
"reference": "0f74f4f9d73580bd039cee54c4744b546a6a7990"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSJsRoutingBundle/zipball/0f74f4f9d73580bd039cee54c4744b546a6a7990",
"reference": "0f74f4f9d73580bd039cee54c4744b546a6a7990",
"shasum": ""
},
"require": {
"php": "^5.3.9|^7.0",
"symfony/console": "~2.7||~3.0|^4.0",
"symfony/framework-bundle": "~2.7||~3.0|^4.0",
"symfony/serializer": "~2.7||~3.0|^4.0",
"willdurand/jsonp-callback-validator": "~1.0"
},
"require-dev": {
"symfony/expression-language": "~2.7||~3.0|^4.0",
"symfony/phpunit-bridge": "^3.3|^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"FOS\\JsRoutingBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "FriendsOfSymfony Community",
"homepage": "https://github.com/friendsofsymfony/FOSJsRoutingBundle/contributors"
},
{
"name": "William Durand",
"email": "will+git@drnd.me"
}
],
"description": "A pretty nice way to expose your Symfony2 routing to client applications.",
"homepage": "http://friendsofsymfony.github.com",
"keywords": [
"Js Routing",
"javascript",
"routing"
],
"time": "2018-02-07T20:08:48+00:00"
},
{
"name": "friendsofsymfony/user-bundle",
"version": "v2.1.2",
......@@ -2724,6 +2783,46 @@
"templating"
],
"time": "2018-03-20T04:25:58+00:00"
},
{
"name": "willdurand/jsonp-callback-validator",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/willdurand/JsonpCallbackValidator.git",
"reference": "1a7d388bb521959e612ef50c5c7b1691b097e909"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/willdurand/JsonpCallbackValidator/zipball/1a7d388bb521959e612ef50c5c7b1691b097e909",
"reference": "1a7d388bb521959e612ef50c5c7b1691b097e909",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7"
},
"type": "library",
"autoload": {
"psr-0": {
"JsonpCallbackValidator": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "William Durand",
"email": "william.durand1@gmail.com",
"homepage": "http://www.willdurand.fr"
}
],
"description": "JSONP callback validator.",
"time": "2014-01-20T22:35:06+00:00"
}
],
"packages-dev": [
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment