Skip to content

Commit d18d99f

Browse files
committed
Correct usage example + conform intro to other docs
1 parent 0b690d4 commit d18d99f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,42 @@
77

88
## Installation
99

10-
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
11-
12-
The recommended way to install composer packages is:
10+
Install this plugin into your CakePHP application using [composer](http://getcomposer.org):
1311

1412
```
1513
composer require admad/cakephp-sequence
1614
```
1715

18-
Then load the plugin by adding the following to your app's config/boostrap.php:
16+
Then load the plugin by either running:
1917

20-
```php
21-
\Cake\Core\Plugin::load('ADmad/Sequence');
18+
```bash
19+
./bin/cake plugin load ADmad/Sequence
2220
```
2321

24-
or using CakePHP's console:
22+
or adding the following line to `config/bootstrap.php`:
2523

26-
```
27-
./bin/cake plugin load ADmad/Sequence
24+
```php
25+
\Cake\Core\Plugin::load('ADmad/Sequence');
2826
```
2927

3028
## How it works
3129

32-
`SequenceBehavior` provided by this plugin maintains a contiguous sequence of
33-
integers in a selected column, for records in a table records (optionally with grouping)
30+
`SequenceBehavior` provided by this plugin maintains a contiguous sequence of
31+
integers in a selected column, for records in a table records (optionally with grouping)
3432
when adding, editing (including moving groups) or deleting records.
3533

3634
## Usage
3735

3836
Add the `SequenceBehavior` for your table and viola:
3937

4038
```php
41-
$this->addBehavior('ADmad/Sequence');
39+
$this->addBehavior('ADmad/Sequence.Sequence');
4240
```
4341

4442
You can customize various options as shown:
4543

4644
```php
47-
$this->addBehavior('ADmad/Sequence', [
45+
$this->addBehavior('ADmad/Sequence.Sequence', [
4846
'order' => 'position', // Field to use to store integer sequence. Default "position".
4947
'scope' => ['group_id'], // Array of field names to use for grouping records. Default [].
5048
'start' => 1, // Initial value for sequence. Default 1.

0 commit comments

Comments
 (0)