Skip to content

Commit 932b5df

Browse files
author
Mark Scherer
committed
Add routing
1 parent 47753b9 commit 932b5df

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

config/routes.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<?php
22
use Cake\Routing\Router;
33

4+
Router::prefix('admin', function ($routes) {
5+
$routes->plugin('Queue', function ($routes) {
6+
$routes->connect('/', ['controller' => 'Queue', 'action' => 'index'], ['routeClass' => 'DashedRoute']);
7+
8+
$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);
9+
$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);
10+
});
11+
});
12+
413
Router::plugin('Queue', ['path' => '/queue'], function ($routes) {
514
$routes->connect('/:controller');
615
});

docs/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
composer require dereuromark/cakephp-queue:dev-master
77
```
88

9-
* Enable the plugin within your config/bootstrap.php (unless you use loadAll):
10-
11-
Plugin::load('Queue');
12-
13-
* Run the following command in the CakePHP console to create the tables using the Migrations plugin:
14-
15-
cake Migrations migrate -p Queue
9+
Enable the plugin within your config/bootstrap.php (unless you use loadAll):
10+
```php
11+
Plugin::load('Queue');
12+
```
13+
If you want to also access the backend controller (not just using CLI), you need to use
14+
```php
15+
Plugin::load('Queue', ['routes' => true]);
16+
```
1617

18+
Run the following command in the CakePHP console to create the tables using the Migrations plugin:
19+
```php
20+
cake Migrations migrate -p Queue
21+
```
1722

1823
## Configuration:
1924

@@ -63,7 +68,7 @@ return [
6368
];
6469
```
6570

66-
You can also drop the configuration into an existing config file that is already been loaded.
71+
You can also drop the configuration into an existing config file (recommended) that is already been loaded.
6772
The values above are the default settings which apply, when no configuration is found.
6873

6974

src/Controller/Admin/QueueController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class QueueController extends AppController {
1111
/**
1212
* @var string
1313
*/
14-
public $modelClass = 'Queue.QueuedTask';
14+
public $modelClass = 'Queue.QueuedTasks';
1515

1616
/**
1717
* QueueController::beforeFilter()

0 commit comments

Comments
 (0)