By type
/Controllers
/Events
/Models
By topic
/Comments
/Posts
<?php | |
// POST | |
if ($this->request->is('post') || $this->request->is('put')) { | |
$uniqId = uniqid(); | |
$this->Session->write('Search.' . $uniqId, json_encode($this->request->data)); | |
// REDIRECT | |
return $this->redirect('index/search:' . $uniqId); | |
// GET |
<?php | |
function getAddressDetails($cep) | |
{ | |
$data = [ | |
'cepEntrada' => $cep, | |
'tipoCep' => '', | |
'cepTemp' => '', | |
'metodo' => 'buscarCep' | |
]; | |
$requestOptions = [ |
<?php | |
interface DataManagement | |
{ | |
} | |
class Curl implements DataManagement | |
{ | |
private $configs; |
// Model Gender | |
public function getList() | |
{ | |
return [ | |
'M' => 'Masculino', | |
'F' => 'Feminino' | |
]; | |
) | |
// Controller |
SELECT CONVERT(CONVERT(COLUNA_ERRADA USING BINARY) USING latin1) AS latin1, | |
CONVERT(CONVERT(COLUNA_ERRADA USING BINARY) USING utf8) AS utf8 | |
FROM NOME_DA_TABELA | |
WHERE CONVERT(COLUNA_ERRADA USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']') |
<?php | |
// PHP 5.4+ | |
class GenericController | |
{ | |
public $limit = 99999; | |
public final function paginate( | |
$object = null, | |
array $scope = [], |
<?php | |
// Controller | |
public function add_cart($id = null) | |
{ | |
$product = $this->Product->find( | |
'first', | |
array( | |
'recursive' => -1, | |
'fields' => array( | |
'Product.id', |
<?php | |
class App | |
{ | |
public $controllerTitle = null; | |
public function beforeFilter() | |
{ | |
if ($this->controllerTitle) { | |
$this->set('controllerTitle', $this->controllerTitle); | |
} |
<?php | |
/** | |
* Class AdController | |
*/ | |
class AdController extends Controller | |
{ | |
/** | |
* @var array | |
*/ |
By type
/Controllers
/Events
/Models
By topic
/Comments
/Posts