summaryrefslogtreecommitdiff
path: root/doc/es_ES/plugin-helpers.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'doc/es_ES/plugin-helpers.markdown')
-rw-r--r--doc/es_ES/plugin-helpers.markdown39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/es_ES/plugin-helpers.markdown b/doc/es_ES/plugin-helpers.markdown
new file mode 100644
index 00000000..66591075
--- /dev/null
+++ b/doc/es_ES/plugin-helpers.markdown
@@ -0,0 +1,39 @@
+Registrar nuevos helpers
+=======================
+
+Estrucura del helper:
+
+```php
+<?php
+
+namespace Kanboard\Plugin\MyPlugin\Helper\MyHelper;
+
+use Kanboard\Core\Base;
+
+class MyHelper extends Base
+{
+ public function doSomething()
+ {
+ return 'foobar';
+ }
+}
+```
+Registrar tu helper en la clase:
+
+```php
+$this->helper->register('myHelper', '\Kanboard\Plugin\MyPlugin\Helper\MyHelper');
+```
+
+Usar tu helper desde una plantilla **Template**:
+
+```php
+<p>
+ <?= $this->myHelper->doSomething() ?>
+</p>
+```
+
+Usar tu helper dese otra clase:
+
+```php
+$this->helper->myHelper->doSomething();
+```