Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
ini_set("display_errors", 1); | |
chdir(dirname(__DIR__) . '/../../'); | |
require_once 'vendor/.composer/autoload.php'; | |
$appConfig = include 'config/application.config.php'; | |
$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']); | |
$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions); | |
$defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php'); |
<?php | |
require_once ('PHPUnit/Autoload.php'); | |
class FailingTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testTestThatWeJustFail() | |
{ | |
$this->assertTrue(true); | |
} |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
'view_helpers' => array( | |
'invokables' => array( | |
'currentlocale' => 'ShiftKernel\Locale\ViewHelper\Locale', | |
), | |
'factories' => array( | |
'currentlocale' => function($sm) { | |
return new \ShiftKernel\Locale\ViewHelper\Locale( | |
$sm->get('ShiftKernel\Locale\LocaleService') | |
); | |
}, |
//action helpers (controller plugins) | |
'controller_plugins' => array( | |
'invokables' => array( | |
'isAllowed' => 'ShiftUser\Access\ActionHelper\IsAllowed' | |
), | |
'factories' => array( | |
'ShiftUser\Access\ActionHelper\IsAllowed' => function($sm){ | |
$class = new \ShiftUser\Access\ActionHelper\IsAllowed($sm); | |
$class->createByFactory(); |
Looking for a way to define a view helper via configuration. That helper should be created via callback factory and have a dependency injected in constructor, as per documentation here: Registering Helpers
So there we go with a helper itself:
class Locale extends AbstractHelper
{
protected $localeService;
/** | |
* Construct | |
* Instantiates the form and configures input fields | |
* | |
* @return void | |
*/ | |
public function __construct($name, array $options = array()) | |
{ | |
//init | |
parent::__construct($name, $options); |
<?php | |
/** | |
* Example action | |
* This is an example action that tests binding of forms to entities. | |
* @return \Zend\View\Model\ViewModel | |
*/ | |
public function exampleAction() | |
{ | |
$node = new ArrayObject(array( |
#!/bin/bash | |
# Make sure we have the dev tools | |
yum groupinstall "Development Tools" | |
# Just in case you started installing dependencies from yum | |
yum -y remove libnfnetlink | |
# lets put the source code here | |
mkdir -p ~/.src |
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |