Search code examples
phplithium

Extending helper functions in Lithium


I want to use this code to extend the form helper class, can someone explain where I need to save the code and how to make sure it gets included when I create my forms.

Currently I've saved it to extensions/helper/Forms.php and then calling it with

<?php use app\extensions\helper\Form; ?>

inside my controller.


Solution

  • You've placed and named the file correctly. But helpers are used inside templates.

    <p>Here is a <?= $this->html->link('link', 'http://li3.me') ?> you'll all enjoy.</p>
    

    See the manual for more info http://li3.me/docs/manual/views/helpers.md