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 | |
// the layout | |
header( 'Content-type: application/octet-stream' ); | |
header( 'Content-Disposition: attachment; filename="my-data.csv"'); | |
echo $content_for_layout; | |
?> |
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 | |
// the view to create csv's | |
$a = array_keys( ClassRegistry::init( Inflector::singularize( $this->name ) )->_schema ); | |
$needed = array( | |
Inflector::singularize( $this->name ) => $a | |
); | |
$row = array(); | |
if ( !empty( $data ) ) |
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 | |
// Created by Guido Rossi <[email protected]> | |
// Date: 28/03/2008 | |
// License: GNU General Public License v3 | |
// Version: 1.1 | |
class YahooFinance{ | |
var $simbol; |
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
<h2>A test to make sure google is working</h2><?php | |
echo $this->Chart->test(); | |
?><h2>Same as above but through the helper</h2><?php | |
echo $this->Chart->display( | |
'pie3d', | |
array( | |
'data' => '60,40', | |
'labels' => 'Hello,World', | |
'size' => '250,100', |
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 | |
/** | |
* Inflect Shell | |
* | |
* Inflect the heck out of your word(s) | |
* | |
* @category Shell | |
* @package Subway | |
* @version 0.1 | |
* @author Jose Diaz-Gonzalez |
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 | |
foreach(range('a', 'z') as $letter) { | |
echo $letter; | |
} | |
?> | |
This function will also work with numbers. This will print all the numbers from 1 to 12. | |
<?php | |
foreach(range(0, 12) as $number) { |
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 | |
class ContactComponent extends Object { | |
/** | |
* components being used here | |
*/ | |
var $components = array(); | |
var $errors = null; | |
var $setup = array( |
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 | |
class VoucherComponent extends Object { | |
/** | |
* components being used here | |
*/ | |
var $components = array(); | |
/** | |
* The path to the voucher template | |
*/ |
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
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; | |
DROP TABLE IF EXISTS `access_permissions`; | |
CREATE TABLE `access_permissions` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`model` varchar(32) COLLATE utf8_unicode_ci NOT NULL, | |
`foreign_id` int(11) NOT NULL, | |
`uid` int(11) NOT NULL, | |
`gid` int(11) NOT NULL, | |
`perms` int(3) NOT NULL DEFAULT '0', |
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 setup( &$Model, $settings ) | |
{ | |
$this->settings[$Model->alias] = array_merge( | |
$this->settings[$Model->alias], | |
(array)$settings | |
); | |
$this->settings[$Model->alias]['model'] = $Model->alias; |
OlderNewer