Skip to content

Instantly share code, notes, and snippets.

View stefanheimes's full-sized avatar

Stefan Heimes stefanheimes

  • MEN AT WORK
  • Lage
View GitHub Profile
<?php
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\Properties\DefaultProperty;
use ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent;
return array
(
BuildDataDefinitionEvent::NAME => array(
array(
function (BuildDataDefinitionEvent $event) {
@stefanheimes
stefanheimes / TreePicker.php
Created February 11, 2016 16:11
Hidden Items for Min/Max - Level
<?php
/**
* Generate the tree view for a given collection.
*
* @param CollectionInterface $objCollection The collection to iterate over.
*
* @param string $treeClass The class to use for the tree.
*
* @return string
@stefanheimes
stefanheimes / SearchablePhp.php
Last active August 29, 2015 14:09
Searchable Pages for MetaModels
<?php
/**
* Created by PhpStorm.
* User: stefan.heimes
* Date: 10.11.2014
* Time: 11:53
*/
namespace FooBaa\MetaModels;
<?php
/**
* PHP version 5
*
* @copyright MEN AT WORK 2014
* @license LGPL-3.0+
* @filesource
*/
@stefanheimes
stefanheimes / Helper.php
Last active August 29, 2015 14:01
A helper class for building a breadcrumb for a given page alias.
<?php
/**
* Contao Open Source CMS
*
* @copyright MEN AT WORK 2014
* @package Helper
* @license GNU/LGPL
* @filesource
*/
@stefanheimes
stefanheimes / gist:9786945
Last active August 29, 2015 13:57
PHP CLI Caller
<?php
/**
* Contao Open Source CMS
*
* @copyright MEN AT WORK 2014
* @package .....
* @license GNU/LGPL
* @filesource
*/
@stefanheimes
stefanheimes / gist:9538959
Created March 13, 2014 22:58
Trace for php
<?php
function log_place()
{
$e = new \Exception();
$trace = $e->getTrace();
$file = @$trace[0]['file'];
$line = @$trace[0]['line'];
$class = @$trace[1]['class'];
@stefanheimes
stefanheimes / gist:9277192
Created February 28, 2014 18:49
Database
mysql -u [user] -p[password] [database] -P [port] -h [host]
@stefanheimes
stefanheimes / config.php
Last active January 4, 2016 18:09
Contao - Inserttag for counting entries.
<?php
// config.php
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('ExtendedComments', 'myReplaceInsertTags');
class ExtendedComments
{
/**
* Replace a inserttag.
*
* @param $strTag The inserttag.
@stefanheimes
stefanheimes / gist:7920427
Created December 11, 2013 23:27
Inserttags für MM - Überarbeitete Version - Alpha
<?php
/**
* The MetaModels extension allows the creation of multiple collections of custom items,
* each with its own unique set of selectable attributes, with attribute extendability.
* The Front-End modules allow you to build powerful listing and filtering of the
* data in each collection.
*
* PHP version 5
* @package MetaModels