/** * Get View Helper Configuration * * @return array */ public function getViewHelperConfig() { return array('factories' => array('formElementErrors' => function ($sm) { $fee = new FormElementErrors(); $fee->setMessageCloseString('</li></ul>'); $fee->setMessageOpenFormat('<ul%s><li>'); $fee->setMessageSeparatorString('</li><li>'); $fee->setAttributes(array('class' => 'help-inline')); return $fee; })); }
/** * {@inheritDoc} * * @return FormElementErrors */ public function createService(ServiceLocatorInterface $serviceLocator) { $serviceLocator = $serviceLocator->getServiceLocator(); $helper = new FormElementErrors(); $config = $serviceLocator->get('Config'); if (isset($config['view_helper_config']['formelementerrors'])) { $configHelper = $config['view_helper_config']['formelementerrors']; if (isset($configHelper['message_open_format'])) { $helper->setMessageOpenFormat($configHelper['message_open_format']); } if (isset($configHelper['message_separator_string'])) { $helper->setMessageSeparatorString($configHelper['message_separator_string']); } if (isset($configHelper['message_close_string'])) { $helper->setMessageCloseString($configHelper['message_close_string']); } } return $helper; }