Skip to content

Commit 7ea5753

Browse files
committed
Updated to 1.0.3 version
1 parent 6975dc0 commit 7ea5753

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

README.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,49 @@ Hook::getInstance();
6565

6666
**setSingletonName()**
6767
```php
68-
setSingletonName($method);
68+
Hook::setSingletonName($method);
6969
```
7070

71-
| Atttribute | Description | Type |
71+
| Atttribute | Description | Type | Required | Default
7272
| --- | --- | --- |
73-
| $method | Set method name for use singleton pattern | string |
73+
| $method | Set method name for use singleton pattern | string | Yes | |
7474

75+
**addAction()**
76+
```php
77+
Hook::addAction($tag, $function, $priority, $args);
78+
```
7579

80+
| Atttribute | Description | Type | Required | Default
81+
| --- | --- | --- |
82+
| $tag | Action hook name | string | Yes | |
83+
| $function | Function to attach to action hook | callable | Yes | |
84+
| $priority | Set method name for use singleton pattern | int | No | 8 |
85+
| $args | Set method name for use singleton pattern | int | No | 0 |
7686

77-
**Hook::addAction**($tag, $function, $priority, $args);
78-
79-
$tag → (**string**) → Action hook name.
80-
81-
$func → (**callable**) → Function to attach to action hook.
82-
83-
$priority → (**int**) (Optional) → Order in which the action is executed.
84-
85-
$args → (**int**) (Optional) → Number of arguments accepted.
86-
87-
**Hook::addActions**($actions);
88-
89-
$actions → (**array**) → Number of arguments accepted.
90-
91-
**Hook::doAction**($tag, $args, $remove);
87+
**addActions()**
88+
```php
89+
Hook::addActions($actions);
90+
```
9291

93-
$tag → (**string**) → Action hook name.
92+
| Atttribute | Description | Type | Required | Default
93+
| --- | --- | --- |
94+
| $actions | Actions hooks | array | Yes | |
9495

95-
$args → (**mixed**) (Optional) → Optional arguments.
96+
**doAction()**
97+
```php
98+
Hook::doAction($tag, $args, $remove);
99+
```
96100

97-
$remove → (**boolean**) (Optional) → Delete hook after executing actions.
101+
| Atttribute | Description | Type | Required | Default
102+
| --- | --- | --- |
103+
| $tag | Action hook name | string | Yes | |
104+
| $args | Optional arguments | mixed | No | array() |
105+
| $remove | Delete hook after executing actions | boolean | No | true |
98106

99-
**Hook::current**();
107+
**current()**
108+
```php
109+
Hook::current();
110+
```
100111

101112
### Usage
102113

0 commit comments

Comments
 (0)