Blame view

config/routes.php 3.88 KB
6c4edfa3   Alexandre   First Commit LabI...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different URLs to chosen controllers and their actions (functions).
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;

/**
 * The default class to use for all routes
 *
 * The following route classes are supplied with CakePHP and are appropriate
 * to set as the default:
 *
 * - Route
 * - InflectedRoute
 * - DashedRoute
 *
 * If no call is made to `Router::defaultRouteClass()`, the class used is
 * `Route` (`Cake\Routing\Route\Route`)
 *
 * Note that `Route` does not do any inflections on URLs which will result in
 * inconsistently cased URLs when used with `:plugin`, `:controller` and
 * `:action` markers.
 *
 */
Router::defaultRouteClass('DashedRoute');
bcc25a64   Etienne Pallier   Tests génériques ...
44
//Router::extensions(['json', 'xml', 'label']);
6c4edfa3   Alexandre   First Commit LabI...
45
46

Router::scope('/', function (RouteBuilder $routes) {
bcc25a64   Etienne Pallier   Tests génériques ...
47
48
    //$routes->setExtensions(['json', 'xml', 'label']);
    
6c4edfa3   Alexandre   First Commit LabI...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    /**
     * Here, we are connecting '/' (base path) to a controller called 'Pages',
     * its action called 'display', and we pass a param to select the view file
     * to use (in this case, src/Template/Pages/home.ctp)...
     */
    $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

    /**
     * ...and connect the rest of 'Pages' controller's URLs.
     */
    $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);

    /**
     * Connect catchall routes for all controllers.
     *
     * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
     *    `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);`
     *    `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);`
     *
     * Any route class can be used with this method, such as:
     * - DashedRoute
     * - InflectedRoute
     * - Route
     * - Or your own route class
     *
     * You can remove these routes once you've connected the
     * routes you want in your application.
     */
bcc25a64   Etienne Pallier   Tests génériques ...
77
    
6c4edfa3   Alexandre   First Commit LabI...
78
79
80
81
82
83
84
85
    $routes->fallbacks('DashedRoute');
});

/**
 * Load all plugin routes.  See the Plugin documentation on
 * how to customize the loading of plugin routes.
 */
Plugin::routes();
08eb8f28   Etienne Pallier   Bugfix de l'ajout...
86
87

// EP added this 16/4/19 from http://caketuts.key-conseil.fr/index.php/2015/05/18/generer-du-pdf-sous-cakephp-v3/
a743e591   Etienne Pallier   ajout extension pdf
88
89
// Activate pdf extension
//Router::extensions(['pdf']);
3bd92c67   Etienne Pallier   Essai pdf avec no...
90
/*
a743e591   Etienne Pallier   ajout extension pdf
91
92
93
Router::scope('/', function ($routes) {
    $routes->extensions(['pdf']);
});
3bd92c67   Etienne Pallier   Essai pdf avec no...
94
*/
3bd92c67   Etienne Pallier   Essai pdf avec no...
95

ea90a25d   Etienne Pallier   Production avec d...
96
// EP added for dompdf
3bd92c67   Etienne Pallier   Essai pdf avec no...
97
98
Router::scope('/', function (RouteBuilder $routes) {
	$routes->extensions(['pdf']);
4b98d8a3   Etienne Pallier   Génération pdf av...
99
    //$routes->connect('/demo/view/*', ['controller' => 'Demo', 'action' => 'view']);
ea90a25d   Etienne Pallier   Production avec d...
100
101
	$routes->connect('/documents/admission_pdf/*', ['controller' => 'Documents', 'action' => 'admission_pdf']);
	$routes->connect('/documents/sortie_pdf/*', ['controller' => 'Documents', 'action' => 'sortie_pdf']);
a259e5c9   Etienne Pallier   petit bugfix
102
103
104
	$routes->connect('/documents/fiche_materiel_pdf/*', ['controller' => 'Documents', 'action' => 'fiche_materiel_pdf']);
	//$routes->connect('/materiels/create_doc_fiche_materiel_pdf/*', ['controller' => 'Materiels', 'action' => 'create_doc_fiche_materiel_pdf']);
	//$routes->connect('/materiels/create-doc-fiche-materiel-pdf/*', ['controller' => 'Materiels', 'action' => 'create-doc-fiche-materiel-pdf']);
3bd92c67   Etienne Pallier   Essai pdf avec no...
105
});