Skip to content

Commit

Permalink
Updated to 1.0.3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
josantonius committed May 31, 2017
1 parent 9feffcb commit dd02afb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
50 changes: 47 additions & 3 deletions README-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,55 @@ use Josantonius\Hook\Hook;

Métodos disponibles en esta biblioteca:


**getInstance()**
```php
Hook::getInstance();
Hook::setSingletonName();
Hook::addAction();
Hook::addActions();
```

**setSingletonName()**
```php
Hook::setSingletonName($method);
```

| Atributo | Descripción | Tipo | Requerido | Por defecto
| --- | --- | --- | --- | --- |
| $method | Establecer el nombre del método para utilizar el patrón singleton | string || |

**addAction()**
```php
Hook::addAction($tag, $function, $priority, $args);
```

| Atributo | Descripción | Tipo | Requerido | Por defecto
| --- | --- | --- | --- | --- |
| $tag | Nombre del gancho de acción | string || |
| $function | Función donde insertat el gancho de acción | callable || |
| $priority | Orden en que se ejecuta la acción | int | No | 8 |
| $args | Establecer el nombre del método para utilizar el patrón singleton | int | No | 0 |

**addActions()**
```php
Hook::addActions($actions);
```

| Atributo | Descripción | Tipo | Requerido | Por defecto
| --- | --- | --- | --- | --- |
| $actions | Acciones | array || |

**doAction()**
```php
Hook::doAction($tag, $args, $remove);
```

| Atributo | Descripción | Tipo | Requerido | Por defecto
| --- | --- | --- | --- | --- |
| $tag | Nombre del gancho de acción | string || |
| $args | Argumentos opcionales | mixed | No | array() |
| $remove | Eliminar gancho después de ejecutar acciones | boolean | No | true |

**current()**
```php
Hook::current();
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Hook::addAction($tag, $function, $priority, $args);
| --- | --- | --- | --- | --- |
| $tag | Action hook name | string | Yes | |
| $function | Function to attach to action hook | callable | Yes | |
| $priority | Set method name for use singleton pattern | int | No | 8 |
| $args | Set method name for use singleton pattern | int | No | 0 |
| $priority | Order in which the action is executed | int | No | 8 |
| $args | Number of arguments accepted | int | No | 0 |

**addActions()**
```php
Expand Down

0 comments on commit dd02afb

Please sign in to comment.