Skip to content

Instantly share code, notes, and snippets.

View netstyler's full-sized avatar
🎯
Focusing

Falk netstyler

🎯
Focusing
View GitHub Profile
@netstyler
netstyler / gist:3832787
Created October 4, 2012 10:29
cakephp: insert image
<?php
echo $this->Html->image('$path', array('alt'=> 'altText'));
?>
@netstyler
netstyler / gist:df37c1f6330da515e14e
Created September 9, 2014 12:39
wa-basic design classes
.margin-top-5{margin-top:5px;}
.margin-top-10{margin-top:10px;}
.margin-top-20{margin-top:20px;}
.margin-top-30{margin-top:30px;}
.margin-bottom-5{margin-bottom:5px;}
.margin-bottom-10{margin-bottom:10px;}
.margin-bottom-20{margin-bottom:20px;}
.margin-bottom-30{margin-bottom:30px;}
.home-slideshow{margin-top:30px;padding:0px;}
.well-dark{background-color:#000;color:#fff;}
function prep_url($str = '')
{
if ($str == 'http://' OR $str == '')
{
$_POST[$this->_current_field] = '';
return;
}
//++ @PATCH
@netstyler
netstyler / TagCloudHelper.php
Created October 1, 2014 14:43
changed tag helper
<?php
/**
* Copyright 2009-2014, Cake Development Corporation (http://cakedc.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2009-2014, Cake Development Corporation (http://cakedc.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
<?php
App::uses('AppHelper', 'View/Helper');
class WaHelper extends AppHelper {
public $helpers = array('Time');
/**
* Bool
*
@netstyler
netstyler / __get
Last active August 29, 2015 14:09
AbstractService __get
/**
* Magic method for lazy loading Models or Components.
*
* @param string $name Name of the Model or Component to get.
* @return mixed
*/
public function __get($name) {
foreach ($this->uses as $model) {
list($plugin, $modelName) = pluginSplit($model);
<?php
/**
* Copyright 2013 - 2014, Cake Development Corporation (http://cakedc.com)
*
* @copyright Copyright 2013 - 2014, Cake Development Corporation (http://cakedc.com)
*/
App::uses('Object', 'Core');
App::uses('Inflector', 'Utility');
App::uses('ClassRegistry', 'Utility');
@netstyler
netstyler / gist:67b3913425b0100f620d
Created November 19, 2014 13:01
data of saveAll
array(
'Company' => array(
'company' => 'SWA',
'street' => 'not set',
'postal_code' => 'not set',
'city' => 'Sausalito, CA',
'country_id' => '11',
'tel1' => '5106525800',
'email' => 'ron@heckmanncommunications.com',
'url' => 'http://www.swagroup.com',
<?php
App::uses('AppService', 'Service/v1');
class CommentsService extends AppService {
public $api = true;
public $adaptorClass = 'WaJsend';
/**
<?php
App::uses('AppModel', 'Model');
/**
* OfficeApply Model
*
* @property ProfileCategory $ProfileCategory
* @property Country $Country
*/
class OfficeApply extends AppModel {