Permalink
Browse files

remove extra whitespace and readme cleanup

  • Loading branch information...
1 parent 4408135 commit 2433fe0831c3f71c056b011e90526c80b9c24327 @josegonzalez josegonzalez committed Jun 22, 2011
Showing with 12 additions and 12 deletions.
  1. +1 −1 README.textile
  2. +11 −11 controllers/components/rest.php
View
@@ -179,7 +179,7 @@ Example:
<pre><code><?php
class TweetsController extends AppController {
- public $components = array ('Rest.Rest' => array);
+ public $components = array ('Rest.Rest');
public function beforeFilter () {
if (!$this->Auth->user()) {
@@ -103,7 +103,7 @@
'SERVER_PROTOCOL',
)
),
-
+
'ratelimit' => array(
'classlimits' => array(
'Employee' => array('-1 hour', 1000),
@@ -231,7 +231,7 @@ public function startup (&$Controller) {
}
// Rate Limit
- if ($this->_settings['ratelimiter']) {
+ if ($this->_settings['ratelimiter']) {
$credentials = $this->credentials();
$class = @$credentials['class'];
if (!$class) {
@@ -330,9 +330,9 @@ protected function _modelizePost (&$data) {
if (!is_array($data)) {
return $data;
}
-
+
// Don't throw errors if data is already modelized
- // f.e. sending a serialized FormHelper form via ajax
+ // f.e. sending a serialized FormHelper form via ajax
if (isset($data[$this->Controller->modelClass])) {
$data = $data[$this->Controller->modelClass];
}
@@ -764,18 +764,18 @@ public function inject ($take, $viewVars) {
* @return array
*/
public function response ($data = array()) {
-
+
// In case of edit, return what post data was received
if (empty($data) && !empty($this->postData)) {
$data = $this->postData;
-
+
// import validation errors
$modelClass = $this->Controller->modelClass;
- $modelErrors = $this->Controller->{$modelClass}->validationErrors;
-
- if (!empty($modelErrors))
- $this->validate($modelErrors);
+ $modelErrors = $this->Controller->{$modelClass}->validationErrors;
+
+ if (!empty($modelErrors))
+ $this->validate($modelErrors);
}
$feedback = $this->getFeedBack(true);
@@ -788,7 +788,7 @@ public function response ($data = array()) {
$server[$lc] = $v;
unset($server[$k]);
}
-
+
$hasErrors = count(@$this->_feedback['error']);
$hasValidationErrors = count(@$this->_feedback['validate']);

0 comments on commit 2433fe0

Please sign in to comment.