Skip to content

Commit 09d3bee

Browse files
committed
Make routing optional, fixes #17
1 parent 6226cb1 commit 09d3bee

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

examples/Files.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class Files extends \Tatter\Files\Config\Files
1919
*/
2020
public $storagePath = WRITEPATH . 'files/';
2121

22+
/**
23+
* Whether to include routes to the Files Controller.
24+
*
25+
* @var boolean
26+
*/
27+
public $routeFiles = true;
28+
2229
/**
2330
* Layouts to use for general access and for administration
2431
*

src/Config/Files.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ class Files extends BaseConfig
1111
*/
1212
public $storagePath = WRITEPATH . 'files/';
1313

14+
/**
15+
* Whether to include routes to the Files Controller.
16+
*
17+
* @var boolean
18+
*/
19+
public $routeFiles = true;
20+
1421
/**
1522
* Layouts to use for general access and for administration
1623
*

src/Config/Routes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
if (empty(config('Files')->routeFiles))
4+
{
5+
return;
6+
}
7+
38
// Routes to Files controller
49
$routes->group('files', ['namespace' => '\Tatter\Files\Controllers'], function ($routes)
510
{

0 commit comments

Comments
 (0)