This file contains hidden or 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
// Render the inputs, except id | |
echo $this->Form->inputs( | |
array( | |
'id' => false, | |
'name' => array( | |
... | |
) | |
), | |
array( |
This file contains hidden or 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
<div class="row"> | |
<div class="col-lg-6"> | |
<?php | |
echo $this->Form->create($x->createModel(), $x->options()); | |
echo $this->Form->inputs($fields->inputs(), $nulll, fields->options()); | |
$buttons = $x->buttons(); | |
foreach($buttons as $button) { | |
echo $this->Form->submit($button->name(), $button->options()); |
This file contains hidden or 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 | |
App::uses('AppController', 'Controller'); | |
class CountriesController extends AppController { | |
public $components = array('Paginator'); | |
public function view($id = null) { | |
if (!$id) { |
This file contains hidden or 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
root @ dev [ /var/www/cakephp.dev/htdocs/app/webroot ] (master $%=) | |
-> cat infinite.php | |
<?php | |
echo ini_get('error_log') . "\n"; | |
function recurse() { | |
return recurse(); | |
} | |
recurse(); |
This file contains hidden or 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 | |
$formatter = function($entity) use ($preferredlanguage, $translatedFields) { | |
foreach ($entity->translations as $translation) { | |
if ($translation->locale === $preferredlanguage) { | |
$field = $translation->get('field'); | |
$value = $translation->get('value'); | |
$entity->set($field, $value); | |
} | |
} |
This file contains hidden or 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
air:cakephp andy$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'debian7-bownty-21052013'... | |
[default] Matching MAC address for NAT networking... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Creating shared folders metadata... | |
[default] Clearing any previously set network interfaces... | |
There was an error while executing `VBoxManage`, a CLI used by Vagrant | |
for controlling VirtualBox. The command and stderr is shown below. |
This file contains hidden or 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
<head> | |
... | |
<script> | |
APP = <?= json_encode(array('user' => Auth::user())); ?>; | |
</script> | |
</head> | |
<body> | |
... | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script>window.jQuery || document.write('<script src="/js/vendor/jquery-1.10.2.min.js"><\/script>')</script> |
This file contains hidden or 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
{ | |
"name": "friendsofcake/app-template", | |
"description": "An empty CakePHP 2.4 application", | |
"type": "project", | |
"keywords" : [], | |
"homepage" : "http://cakephp.org", | |
"license" : "MIT", | |
"require" : { | |
"php" : ">=5.4", | |
"composer/installers" : "~1.0", |
This file contains hidden or 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 | |
$null = null; | |
$notNull = 123; | |
$is_null = function($value) { | |
for($i = 0; $i < 1000000; $i++) { | |
$result = is_null($value); | |
} | |
return "is_null"; | |
}; |
This file contains hidden or 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
-> grep -r "version_compare([^,]*,[^,]*)" * | |
lib/Cake/Utility/File.php: if ($all === false && version_compare(PHP_VERSION, '5.3.0') >= 0) { | |
lib/Cake/Utility/Debugger.php: if (version_compare(PHP_VERSION, '5.3.0') >= 0) { | |
lib/Cake/Console/Command/ServerShell.php: if (version_compare(PHP_VERSION, '5.4.0') < 0) { | |
lib/Cake/Test/Case/Utility/DebuggerTest.php: if (version_compare(PHP_VERSION, '5.3.0') >= |