Created
December 10, 2014 14:56
-
-
Save matyax/ab67ff394f50ad9819d2 to your computer and use it in GitHub Desktop.
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 | |
// Una alternativa | |
$flavors1 = [ 'chocolate', 'strawberry', 'vanilla', | |
'chocolate chip', 'mint chocolate chip', 'rocky road', | |
'cookie dough', 'peach', 'fudge brownie', | |
'coffee', 'mocha chip' ]; | |
class PeopleController extends AppController { | |
public function index() { | |
if (! $this->request->is('post')) { | |
//descartar condiciones en vez de anidarlas | |
//sorry, me sale el Nazi | |
return; | |
} | |
//otra alternativa | |
if ($condition1 == true) { | |
$flavors1 = [ | |
'chocolate', | |
'strawberry', | |
'vanilla', | |
'cookie dough', | |
'chocolate chip', | |
'mint chocolate chip', | |
'rocky road', | |
'peach', | |
'fudge brownie', | |
'coffee', | |
'mocha chip' | |
]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment