We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Реализация поддержка Helperов для класса, есть наверное и для этого патерн, но я его не знаю, а по факту это отдельные методы в отдельных файлах
Код класса:
namespace Application; /** * @method void foo(string $text) */ class My { use Helper; public function __construct() { // initial default helper path $this->addHelperPath(dirname(__FILE__) . '/Helper/'); } }
Код помощника в файле /Helper/Foo.php
/Helper/Foo.php
return function ($text) { print($text); }
Использование:
$my = new My(); $my->foo('Hello!'); // => Hello!
При добавление помощников в репозиторий, следует описать метод в doccomment'ах расширяемого файла, что позволит использовать автодополнение в IDE.
Acl Application Auth Cache Common — Exception — Collection — Container — Helper — Options — Singleton Config Controller — Data — Mapper —— Crud —— Rest — Reflection Crud — Crud Table Db — Row — Table — Relations — Query Debug EventManager Grid Http Layout Logger Mailer Messages Nil Proxy Registry Request Response Router Session Translator Validator View