This file contains hidden or 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 ProcessWire; | |
/** | |
* A simple module-boilerplate | |
* | |
* @see https://gist.github.com/yckart/7040320 | |
* @see http://wiki.processwire.com/index.php/Module_Creation | |
*/ | |
class ModuleBoilerplate extends WireData implements Module, ConfigurableModule { |
This file contains hidden or 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
(function (name, definition){ | |
if (typeof define === 'function'){ // AMD | |
define(definition); | |
} else if (typeof module !== 'undefined' && module.exports) { // Node.js | |
module.exports = definition(); | |
} else { // Browser | |
var theModule = definition(), global = this, old = global[name]; | |
theModule.noConflict = function () { | |
global[name] = old; | |
return theModule; |
This file contains hidden or 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
/** | |
* placeSVG | |
* | |
* verson 1.0.4 | |
* | |
* Insert svg file as svg markup or image tag | |
* | |
* @param String $filename file relative to templates folder | |
* @param array $option | |
* String markup 'img'|null, defines output |
This file contains hidden or 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 | |
/** | |
* value_in | |
* | |
* @param mixed $haystack array or object or nested mix of both | |
* @param string $path path in any token-separated notation | |
* @param string $token path separator token | |
* @return mixed resolved value | |
*/ |
This file contains hidden or 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
/** | |
* getFieldsetOf | |
* | |
* for ProcessWire | |
* | |
* gets fields inside a fieldset of pages or templates | |
* choose to retrieve values | |
* | |
* @param Template|Page $context the page or template | |
* @param String $fieldsetName name of the fieldset |