Skip to content

Commit

Permalink
Updated action signatures to use underscores instead of camelCase
Browse files Browse the repository at this point in the history
Change should remove any ambiguities new developers have when attempting to figure out action signatures
  • Loading branch information
josegonzalez committed Apr 1, 2012
1 parent 93bb9cf commit 3d1195e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion en/controllers.rst
Expand Up @@ -332,7 +332,7 @@ Flow Control
you might wish to redirect them to a receipt screen.::

<?php
public function placeOrder() {
public function place_order() {
// Logic for finalizing order goes here
if ($success) {
$this->redirect(array('controller' => 'orders', 'action' => 'thanks'));
Expand Down
4 changes: 2 additions & 2 deletions en/core-libraries/components/access-control-lists.rst
Expand Up @@ -522,7 +522,7 @@ models to save data like we always do:
::

<?php
function anyAction() {
function any_action() {
$aro =& $this->Acl->Aro;
// Here's all of our group info in an array we can iterate through
Expand Down Expand Up @@ -587,7 +587,7 @@ specific model records in our database.
::

<?php
function anyAction() {
function any_action() {
$aro = new Aro();
// Here are our user records, ready to be linked up to new ARO records
Expand Down
2 changes: 1 addition & 1 deletion en/models.rst
Expand Up @@ -104,7 +104,7 @@ model::
<?php
class Recipe extends AppModel {

public function steakRecipes() {
public function steak_recipes() {
$ingredient = $this->Ingredient->findByName('Steak');
return $this->findAllByMainIngredient($ingredient['Ingredient']['id']);
}
Expand Down
4 changes: 2 additions & 2 deletions en/models/associations-linking-models-together.rst
Expand Up @@ -841,7 +841,7 @@ purposes, let's use unbindModel() to remove that association in a
controller action::

<?php
public function someAction() {
public function some_action() {
// This fetches Leaders, and their associated Followers
$this->Leader->find('all');
Expand Down Expand Up @@ -888,9 +888,9 @@ following find operation). This function appears in the
LeadersController::

<?php
public function anotherAction() {
// There is no Leader hasMany Principles in
// the leader.php model file, so a find here,
public function another_action() {
// only fetches Leaders.
$this->Leader->find('all');
Expand Down
8 changes: 4 additions & 4 deletions en/views.rst
Expand Up @@ -306,7 +306,7 @@ controller, setting the ``$title_for_layout`` variable::

<?php
class UsersController extends AppController {
public function viewActive() {
public function view_active() {
$this->set('title_for_layout', 'View Active Users');
}
}
Expand Down Expand Up @@ -338,12 +338,12 @@ using something like::

<?php
class UsersController extends AppController {
public function viewActive() {
public function view_active() {
$this->set('title_for_layout', 'View Active Users');
$this->layout = 'default_small_ad';
}

public function viewImage() {
public function view_image() {
$this->layout = 'image';
//output user image
}
Expand All @@ -370,7 +370,7 @@ Contacts plugin::

<?php
class UsersController extends AppController {
public function viewActive() {
public function view_active() {
$this->layout = 'Contacts.contact';
}
}
Expand Down
2 changes: 1 addition & 1 deletion pt/controllers.rst
Expand Up @@ -286,7 +286,7 @@ Controle de Fluxo
de recepção.::

<?php
function placeOrder() {
function place_order() {
// Logic for finalizing order goes here
if ($success) {
$this->redirect(array('controller' => 'orders', 'action' => 'thanks'));
Expand Down
2 changes: 1 addition & 1 deletion ru/models.rst
Expand Up @@ -99,7 +99,7 @@ CakePHP автоматически сделает модель доступно
<?php
class Recipe extends AppModel {

function steakRecipes() {
function steak_recipes() {
$ingredient = $this->Ingredient->findByName('Steak');
return $this->findAllByMainIngredient($ingredient['Ingredient']['id']);
}
Expand Down
6 changes: 3 additions & 3 deletions ru/views.rst
Expand Up @@ -111,7 +111,7 @@

<?php
class UsersController extends AppController {
function viewActive() {
function view_active() {
$this->set('title_for_layout', 'View Active Users');
}
}
Expand Down Expand Up @@ -144,12 +144,12 @@

<?php
class UsersController extends AppController {
public function viewActive() {
public function view_active() {
$this->set('title_for_layout', 'View Active Users');
$this->layout = 'default_small_ad';
}

public function viewImage() {
public function view_image() {
$this->layout = 'image';
//вывод изображения пользователя
}
Expand Down

0 comments on commit 3d1195e

Please sign in to comment.