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
/** | |
* Example: Sometimes you need a bit more validation power on form inputs. For instance, a form validation | |
* may be dependpent on multiple inputs and advanced testing. | |
* | |
* The example below shows the power of $options array. That's where all your form inputs along with some other custom | |
* parts will be stored. The key to getting access to your form POST data is through `values` which lives in $options. | |
* The extract method pulls out the 'values' array providing access to the POST data. | |
* | |
* In this particular example were trying to check if the field input `acronym` is unique among a list of cities in MongoDB. | |
* |
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 | |
/** | |
* Lithium: the most rad php framework | |
* | |
* @copyright Copyright 2010, Union of RAD (http://union-of-rad.org) | |
* @license http://opensource.org/licenses/bsd-license.php The BSD License | |
*/ | |
namespace app\extensions\adapter\session; |
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 app\models; | |
class Base extends \lithium\data\Model { | |
/** | |
* This method gives direct access to the MongoDB collection object from any | |
* model that extends the Base Model. |
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 app\controllers; | |
use lithium\net\socket\curl; | |
class FeedsController extends \lithium\action\Controller { | |
protected $_li3 = array( | |
'scheme' => 'https', | |
'host' => 'api.github.com/repos/fitzagard/li3_sublime/commits', |
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
class Base extends \lithium\data\Model { | |
public $validates = array(); | |
public static function __init(array $options = array()){ | |
parent::__init($options); | |
/** | |
* Add created date to every document created | |
*/ | |
static::applyFilter('create', function($self, $params, $chain){ |