Skip to content

Commit

Permalink
Make routing optional, fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Nov 9, 2020
1 parent 6226cb1 commit 09d3bee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ class Files extends \Tatter\Files\Config\Files
*/
public $storagePath = WRITEPATH . 'files/';

/**
* Whether to include routes to the Files Controller.
*
* @var boolean
*/
public $routeFiles = true;

/**
* Layouts to use for general access and for administration
*
Expand Down
7 changes: 7 additions & 0 deletions src/Config/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class Files extends BaseConfig
*/
public $storagePath = WRITEPATH . 'files/';

/**
* Whether to include routes to the Files Controller.
*
* @var boolean
*/
public $routeFiles = true;

/**
* Layouts to use for general access and for administration
*
Expand Down
5 changes: 5 additions & 0 deletions src/Config/Routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

if (empty(config('Files')->routeFiles))
{
return;
}

// Routes to Files controller
$routes->group('files', ['namespace' => '\Tatter\Files\Controllers'], function ($routes)
{
Expand Down

0 comments on commit 09d3bee

Please sign in to comment.