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 | |
class Forum extends AppModel | |
{ | |
var $actsAs = array('Containable'); | |
var $hasMany = array( | |
'Forums' => array( | |
'className' => 'Forum', | |
'foreignKey' => 'parent_id', |
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
SELECT `Message`.`id`, `Message`.`user_id`, `Message`.`sender_id`, `Message`.`status`, `Message`.`title`, `Message`.`body`, `Message`.`parent_id`, `Message`.`created`, `Message`.`modified`, `Sender`.`id`, `Sender`.`username`, `Sender`.`password`, `Sender`.`created`, `Sender`.`modified`, `Sender`.`active`, `Sender`.`validate_key`, `Sender`.`email`, `Sender`.`status`, `User`.`id`, `User`.`username`, `User`.`password`, `User`.`created`, `User`.`modified`, `User`.`active`, `User`.`validate_key`, `User`.`email`, `User`.`status` FROM `messages` AS `Message` LEFT JOIN `users` AS `Sender` ON (`Message`.`sender_id` = `Sender`.`id`) LEFT JOIN `users` AS `User` ON (`Message`.`user_id` = `User`.`id`) WHERE (`Message`.`user_id` = 11 OR `Message`.`sender_id` = 11) AND ((`Message`.`status` & 8) = 0) ORDER BY `Message`.`modified` DESC, `Message`.`status` DESC |
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 | |
$array = array( | |
'key' => 'value', | |
'key2' => 'value', | |
); | |
//array as string | |
$string = serialize($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 | |
/** | |
* MeioUpload Behavior | |
* This behavior is based on Tane Piper's improved uplaod behavior (http://digitalspaghetti.tooum.net/switchboard/blog/2497:Upload_Behavior_for_CakePHP_12) | |
* @author Vinicius Mendes ([email protected]) | |
* @link http://www.meiocodigo.com | |
* @filesource http://www.meiocodigo.com/meioupload | |
* @version 1.0.1 | |
* @lastmodified 2008-10-04 | |
* |
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 | |
class AppController extends Controller { | |
/** | |
* For controller, does magic | |
* | |
* @var array | |
*/ | |
var $components = array('DebugKit.Toolbar', 'Session', 'Auth', 'Cookie', 'RequestHandler'); | |
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 | |
/** | |
* Abstract class to do some preconfiguration for all controllers | |
* extending this one. | |
* | |
* @package BaseApp | |
*/ | |
abstract class Template_Controller extends Controller | |
{ |
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
public function register() | |
{ | |
$this->View->errors = array(); | |
$this->View->user = new User_Model; | |
if (request::method() == 'post') { | |
$this->View->user->load_values($this->input->post()); | |
$this->View->user->password = $this->input->post('password'); | |
if ($this->View->user->validate($this->input->post())) { |
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 | |
/** | |
* Abstract class to do some preconfiguration for all controllers | |
* extending this one. | |
* | |
* @package BaseApp | |
*/ | |
abstract class Base_Controller extends Controller | |
{ |
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
Debate: | |
actAs: | |
Versionable: | |
auditLog: true | |
versionColumn: version | |
className: %CLASS%Version | |
Timestampable: | |
Sluggable: | |
fields: [title] | |
unique: true |
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 | |
class JsModuleActionFilter extends sfFilter | |
{ | |
public function execute($filterChain) | |
{ | |
if ($this->isFirstCall()) { | |
$params = $this->getContext()->getRequest()->getRequestParameters(); | |
//gets a module action specific js file |
OlderNewer