Skip to content

Instantly share code, notes, and snippets.

View bitkorn's full-sized avatar
💭
do not pull or push

Torsten Brieskorn bitkorn

💭
do not pull or push
View GitHub Profile
@bitkorn
bitkorn / db.local.php
Last active October 27, 2016 09:46
ZF2 multiple database conf
<?php
/**
* first DBConfig
*/
$dbParamsGlobal = array(
'hostname' => 'localhost',
'database' => 'somedbname',
'username' => 'root',
'password' => 'secretpasswd',
@bitkorn
bitkorn / toggleW3.CSS-dropdown.js
Last active October 27, 2016 10:14
toggle W3.CSS dropdown with jQuery
function toggleW3(id) {
var toggleme = $("#" + id);
toggleme.css("z-index", 5);
if (!toggleme.hasClass("w3-show")) {
$("#" + id).addClass("w3-show");
$("#" + id).css("z-index", "1");
$("#" + id).removeClass("w3-hide");
var elementId = "";
$(".w3-dropdown-content").each(function (index, element) {
elementId = $(element).attr("id");
@bitkorn
bitkorn / zf2_routeName-and-route-in-Controller.php
Last active October 31, 2016 16:16
In ZF2 Controller: Get the route from URL and look at database for content to show it in view.
<?php
/**
* Get the route from URL and look at database for content to show it in view.
* @return ViewModel
*/
public function routesCmsAction()
{
$routeMatch = $this->serviceLocator->get('Application')->getMvcEvent()->getRouteMatch();
$routeName = $routeMatch->getMatchedRouteName();