This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AssetManager\Service; | |
use Assetic\Asset\AssetInterface; | |
use Assetic\Filter\FilterInterface; | |
use AssetManager\Exception; | |
use AssetManager\Resolver\MimeResolverAwareInterface; | |
use AssetManager\Service\MimeResolver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AssetManager\Service; | |
use Zend\ServiceManager\FactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\ServiceManager\Config; | |
class AssetFilterManagerServiceFactory implements FactoryInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'view_helpers' => array( | |
'factories' => array( | |
'SimpleHelper' => function(\Zend\View\HelperPluginManager $vh) { | |
$config = $vh->getServiceLocator()->get('Config'); | |
$simpleHelper = new \SimpleHelper(); | |
if ( isset($config['simple_helper']) ) { | |
$simpleHelper->setConfig(($config['simple_helper'])); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Zend\ServiceManager\ServiceLocatorInterface; | |
class SimpleHelperFactory implements \Zend\ServiceManager\FactoryInterface | |
{ | |
public function createService(ServiceLocatorInterface $serviceLocator) | |
{ | |
// Can't do the same here, because of ServiceLocatorInterface | |
$config = $serviceLocator->getServiceLocator()->get('Config'); | |
// Or I can just ignore problem with ServiceLocatorInterface interface here | |
return new SimpleHelper(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'view_helpers' => array( | |
'factories' => array( | |
'SimpleHelperFactory' => 'SimpleHelperFactory' | |
) | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Form; | |
use Zend\Form\Form; | |
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class UserRegister extends Form implements InputFilterProviderInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Form\Fieldset; | |
use Zend\Form\Fieldset as ZendFieldset; | |
use Application\Model\User as ModelUser; | |
use Zend\Stdlib\Hydrator\ClassMethods as ClassMethodsHydrator; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class User extends ZendFieldset implements InputFilterProviderInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$factory = new \Zend\InputFilter\Factory(); | |
$i = $factory->createInputFilter(array( | |
'password' => array( | |
'name' => 'password', | |
'required' => true, | |
'validators' => array( | |
array( | |
'name' => 'not_empty', | |
), | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// somewhere in the module code | |
public function onBootstrap(EventInterface $event) | |
{ | |
/** @var \Zend\Mvc\MvcEvent $event */ | |
$application = $event->getApplication(); | |
$application->getEventManager()->attach('dispatch', function(MvcEvent $event) use ($application) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < 3; i++) { | |
setTimeout(() => { | |
console.log(i); | |
}, i * 1000); | |
} |
OlderNewer