sathyashrayan

custom form element

May 17th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2. namespace MarketPlace\Attributes\Form\Element;
  3.  
  4. use Zend\Form\Element;
  5. use Zend\ServiceManager\ServiceLocatorInterface;
  6. use Zend\ServiceManager\ServiceLocatorAwareInterface;
  7.  
  8.  
  9. class AttributesValidations extends Element implements ServiceLocatorAwareInterface
  10. {
  11.     protected $_serviceLocator;
  12.     protected $class_list;
  13.    
  14.     public function __construct(){
  15.         $this->_class_list = $this->validationList();
  16.     }
  17.     public function setServiceLocator(ServiceLocatorInterface $serviceLocator) {
  18.         $this->_serviceLocator = $serviceLocator;
  19.     }
  20.    
  21.     public function getServiceLocator() {
  22.         return $this->_serviceLocator;
  23.     }
  24.    
  25.     public function validationList() {     
  26.         $validateClass = $this->getServiceLocator()->get('validate_class');
  27.         return $validateClass;
  28.     }
  29.    
  30.    
  31.    
  32. }
Add Comment
Please, Sign In to add comment