Skip to content

Instantly share code, notes, and snippets.

<?php
...
/*
*
* Option tests below here.
*
*
*/
/*
* @province <select> element with opgtroups of provinces separated by country
* @country <select> element
*/
function countryProvinces(province, country)
{
//zf2 select options dont allow non-standard attributes.. hooray.
opts = $(province).children('optgroup').each(function(){
$(this).attr('data-country_code', $(this).children().val().substring(0,2));
});
(function($) {
function countryProvinces(province, country)
{
//zf2 select options dont allow non-standard attributes.. hooray.
opts = $(province).children('optgroup').each(function(){
$(this).attr('data-country_code', $(this).children().val().substring(0,2));
});
$(province).data('options', opts);
$(province).children('optgroup').remove();
function filterProvinces(element, countryCode) {
$(element).val(0);
optGroups = $(element).data('options');
$(optGroups).each(function(){
var match = false
if ($(this).data('country_code') == countryCode) {
$(element).append($(this));
}
})
$(element).find('optgroup').remove();
function filterProvinces(element, countryCode) {
$(element).val(0);
$(element).find('optgroup').remove();
options = $(element).data('options');
//need to get the maching option by countrycode (id)
//$(element).append(html);
}
$(document).ready(function(){
protected function triggerListeners($event, EventInterface $e, $callback = null)
{
$responses = new ResponseCollection;
$listeners = $this->getListeners($event);
// Add shared/wildcard listeners to the list of listeners,
// but don't modify the listeners object
$sharedListeners = $this->getSharedListeners($event);
$sharedWildcardListeners = $this->getSharedListeners('*');
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
// Setup autoloading
include 'init_autoloader.php';
array(1) {
'routes' =>
array(19) {
'home' =>
array(2) {
'type' =>
string(28) "Zend\Mvc\Router\Http\Literal"
'options' =>
array(2) {
'route' =>
array(1) {
'routes' =>
array(19) {
'home' =>
array(2) {
'type' =>
string(28) "Zend\Mvc\Router\Http\Literal"
'options' =>
array(2) {
'route' =>
<?php
namespace Market\Factory;
use Market\Controller\PostController;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class PostControllerFactory implements FactoryInterface
{