This file contains 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
// zuerst data attribute an felder anhängen, dann parsley initialisieren | |
// vorname muss eingegeben werden und mind. 3 zeichen enthalten | |
$('#contact_vorname').data('parsleyRequired', 'true'); | |
$('#contact_vorname').data('parsleyMinlength', 3); | |
// init parsley | |
$('#form').parsley(); |
This file contains 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 if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
* Use faker in pyrocms: | |
* 1. create composer.json in installation root | |
* content: | |
* { | |
* "require-dev": { | |
* "fzaninotto/Faker": "dev-master" | |
* } |
This file contains 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 defined('BASEPATH') or exit('No direct script access allowed'); | |
/** | |
* PyroStreams Text Field Type | |
* | |
* extended field type based on the basic text field type, mgr | |
* | |
* @package PyroStreams | |
* @author PyroCMS Dev Team | |
* @copyright Copyright (c) 2011 - 2013, PyroCMS |
This file contains 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 | |
/** | |
* Convert HTML characters to entities. | |
* | |
* The encoding specified in the application configuration file will be used. | |
* | |
* @param string $value | |
* @return string | |
*/ |
This file contains 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 Laravel; use FilesystemIterator as fIterator; use Closure; | |
class Blade { | |
/** | |
* All of the compiler functions used by Blade. | |
* | |
* @var array | |
*/ | |
protected static $compilers = array( |
This file contains 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 Laravel; | |
class Section { | |
/** | |
* All of the captured sections. | |
* | |
* @var array | |
*/ | |
public static $sections = array(); |
This file contains 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
$data = getData(); | |
$step = 100 / count($data); | |
$percent = 0; | |
echo 'Doing stuff with data: '; //padding at the end for the number | |
foreach($data as $row) | |
{ | |
// do stuff |
This file contains 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
// $c=1 -> A | |
// $c=27 -> AA | |
// combine with the row index to get the correct cell identifier, | |
// e.g. | |
// $column = _excel_column(26); | |
// $cell = $columns . '3'; // = Z3 | |
public function _excel_column($c) | |
{ |
This file contains 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once SHARED_ADDONPATH."modules/[DEIN MODUL]/libraries/[PFAD UND SO HALT]/PHPExcel.php"; | |
class Excel extends PHPExcel { | |
// $this->load->library('Excel'); | |
// dann: | |
// benutzern mit $this->excel->[PHPExcel Funktionen und so] |
This file contains 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
// just make sure the $sort_by key exists in $data | |
public function sort_entries(&$data, $sort_by = false) | |
{ | |
if( ! $sort_by ) | |
{ | |
$sort_by = 'sort'; | |
} | |
usort($data, function($a, $b) use($sort_by) { | |
return strnatcasecmp($a[$sort_by], $b[$sort_by]); |
NewerOlder