Skip to content

Instantly share code, notes, and snippets.

@harikt
Created August 4, 2014 16:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save harikt/eff1b14b79b41e12f62c to your computer and use it in GitHub Desktop.
<?php
namespace Cocoframework\Web_Kernel\Html\Helper;
use Aura\Html\Helper\AbstractHelper;
use Aura\Input\Form;
class InputErrors extends AbstractHelper
{
public function setIntl($intl)
{
$this->intl = $intl;
}
public function setUl($ul_helper)
{
$this->ul_helper = $ul_helper;
}
public function __invoke(Form $form, $field)
{
$errors = $form->getMessages($field);
foreach ($errors as $error) {
// $error
}
}
}
@harikt
Copy link
Author

harikt commented Aug 4, 2014

so you can call like echo $this->inputErrors($this->contact_form, 'email');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment