Skip to content

Instantly share code, notes, and snippets.

View destinydriven's full-sized avatar

destinydriven destinydriven

View GitHub Profile
class AppController extends Controller {
public $components = array(
'Session'
);
{
"name": "smartsubmit/app",
"description": "SmartSubmit Application",
"type": "application",
"keywords": ["framework"],
"homepage": "http://example.com/smartsubmit",
"license": "MIT",
"authors": [
{
"name": "<destinydriven>",
@destinydriven
destinydriven / gist:04f6dad91c0d8234cbef
Created March 4, 2015 20:21
this method fetches the timesheet record based on $timesheet_id and is supposed to pass it to the element containing the bootstrap modal
public function fetch_timesheet($id = null) {
$this->autoRender = false;
$this->layout = 'ajax';
if(!$this->request->is('ajax')){
throw new MethodNotAllowedException(__('This method is not allowed within this context!'));
}
$options = array(
'conditions' => array('Timesheet.' . $this->Timesheet->primaryKey => $id),
{"@timestamp":"2015-03-28T03:44:06.656451+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":"* Shell output:","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2015-03-28T03:44:06.656693+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":" => Loading composer repositories with package
information","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2015-03-28T03:44:06.656818+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":" =>
Installing dependencies from lock file","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2015-03-28T03:44:06.656940+00:00","@source":"cakebox","@fields":
namespace Highcharts\Controller\Component;
use Cake\Controller\Component;
use Ghunti\HighchartsPHP\Highchart;
use Ghunti\HighchartsPHP\HighchartJsExpr;
class HighchartsComponent extends Component {
public function initialize(array $config) {
{
"name": "destinydriven/Highcharts",
"description": "Highcharts plugin for CakePHP",
"type": "cakephp-plugin",
"require": {
"php": ">=5.4",
"ghunti/highcharts-php": "~3.0"
},
"require-dev": {
"phpunit/phpunit": "*"
array(
'0.Employee.id' => '517c57ea-c42c-4dec-be83-1ac089661960',
'0.Employee.last_name' => 'Alexander',
'0.Employee.first_name' => 'Nancy',
'0.Employee.nic_number' => '308766',
'0.Employee.tax_number' => '632541',
'0.Employee.tax_code' => '174',
'0.Employee.active' => true,
'0.EmploymentData.department_id' => '6',
'0.EmploymentData.Department.name' => 'ACCOUNTING & FINANCE',
<?php
foreach($dtResults as $result) {
//$this->log($result, LOG_DEBUG);
$this->dtResponse['aaData'][] = array(
$result['Employee']['id'],
$result['Employee']['last_name'],
$result['Employee']['first_name'],
$result['Employee']['nic_number'],
$result['Employee']['tax_number'],
$result['Employee']['tax_code'],
public $components = array(
'Paginator',
'RequestHandler',
'DataTable.DataTable' => array(
'Employee' => array(
'columns' => array(
'id' => false, // bSearchable and bSortable will be false
'last_name' => array('label' => 'Last Name', 'bSearchable' => true, 'bSortable' => true), // bSearchable and bSortable will be true, with a custom label `Name`
'first_name' => array('label' => 'First Name', 'bSearchable' => true, 'bSortable' => true,),
'nic_number' => array('label' => 'NIC #', 'bSearchable' => true, 'bSortable' => true),
@destinydriven
destinydriven / gist:7df10047a6eb65a3af80
Created July 13, 2015 22:22
FlashComponent::_call()
/**
* Magic method for verbose flash methods based on element names.
*
* For example: $this->Flash->success('My message') would use the
* success.ctp element under `app/View/Element/Flash` for rendering the
* flash message.
*
* @param string $name Element name to use.
* @param array $args Parameters to pass when calling `FlashComponent::set()`.
* @return void