Skip to content

Commit 60f92c8

Browse files
committed
finised the documentation
1 parent 1bac4ba commit 60f92c8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

readme.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ will produce an output
248248
The main benefit of this is that you can define any html element to behave the way you want. The main logic under this is the `handle` method which does the actual rendering.
249249
> When redefining the behavior of an element, do not call the element as a function in its own definition, this can result in an infinite recursion.
250250
251+
*Definition of the handle function*
252+
```php
253+
/**
254+
* @param string $name - The name of the element
255+
* @param array $args - The list of arguments passed to the function
256+
* during creation. For example pm::div(...args)
257+
* @param bool $return - should the created string be printed or
258+
* returned?
259+
*/
260+
handle(string $name, array $args, bool $return = true)
261+
```
262+
251263
**Redefining the `<p>` element**
252264
```php
253265
# custom-tags.php
@@ -269,7 +281,7 @@ pm::component(
269281
);
270282
```
271283

272-
**Whenevery `pm::p(...)` is called, your custom definition will be the default behavior of the p tag**.
284+
**Whenevery `pm::p(...)` is called, your custom definition will be the default behavior of the `p` tag**.
273285

274286

275287
# Installation

0 commit comments

Comments
 (0)