Skip to content

Commit dd02afb

Browse files
committed
Updated to 1.0.3 version
1 parent 9feffcb commit dd02afb

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

README-ES.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,55 @@ use Josantonius\Hook\Hook;
5757

5858
Métodos disponibles en esta biblioteca:
5959

60+
61+
**getInstance()**
6062
```php
6163
Hook::getInstance();
62-
Hook::setSingletonName();
63-
Hook::addAction();
64-
Hook::addActions();
64+
```
65+
66+
**setSingletonName()**
67+
```php
68+
Hook::setSingletonName($method);
69+
```
70+
71+
| Atributo | Descripción | Tipo | Requerido | Por defecto
72+
| --- | --- | --- | --- | --- |
73+
| $method | Establecer el nombre del método para utilizar el patrón singleton | string || |
74+
75+
**addAction()**
76+
```php
77+
Hook::addAction($tag, $function, $priority, $args);
78+
```
79+
80+
| Atributo | Descripción | Tipo | Requerido | Por defecto
81+
| --- | --- | --- | --- | --- |
82+
| $tag | Nombre del gancho de acción | string || |
83+
| $function | Función donde insertat el gancho de acción | callable || |
84+
| $priority | Orden en que se ejecuta la acción | int | No | 8 |
85+
| $args | Establecer el nombre del método para utilizar el patrón singleton | int | No | 0 |
86+
87+
**addActions()**
88+
```php
89+
Hook::addActions($actions);
90+
```
91+
92+
| Atributo | Descripción | Tipo | Requerido | Por defecto
93+
| --- | --- | --- | --- | --- |
94+
| $actions | Acciones | array || |
95+
96+
**doAction()**
97+
```php
98+
Hook::doAction($tag, $args, $remove);
99+
```
100+
101+
| Atributo | Descripción | Tipo | Requerido | Por defecto
102+
| --- | --- | --- | --- | --- |
103+
| $tag | Nombre del gancho de acción | string || |
104+
| $args | Argumentos opcionales | mixed | No | array() |
105+
| $remove | Eliminar gancho después de ejecutar acciones | boolean | No | true |
106+
107+
**current()**
108+
```php
65109
Hook::current();
66110
```
67111

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ Hook::addAction($tag, $function, $priority, $args);
8181
| --- | --- | --- | --- | --- |
8282
| $tag | Action hook name | string | Yes | |
8383
| $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 |
84+
| $priority | Order in which the action is executed | int | No | 8 |
85+
| $args | Number of arguments accepted | int | No | 0 |
8686

8787
**addActions()**
8888
```php

0 commit comments

Comments
 (0)