Skip to content

Instantly share code, notes, and snippets.

<?php
echo $this->Form->input('PricelistServices.' . $service['id'], array(
'type' => 'checkbox',
'label' => $service['description'],
'hiddenField' => false
));
?>
App::build(
[
'Plugin' => [ROOT . '/Plugin/', ROOT . '/app/Plugin/'],
'Vendor' => [ROOT . '/vendor/', ROOT . '/app/Vendor/']
],
App::RESET
);
$data = [
'Nation' => [
'name' => 'ciao1',
'name' => 'ciao2',
'name' => 'ciao3',
'name' => 'ciao4',
'Region' => [
0 => array(
'name' => 'oookoook',
if (!empty($form['Ad']['AdService']))
{
$services = [];
foreach ($form['Ad']['AdService'] as $service)
{
array_push($services, [
'id' => $this->AdService->field('id', [
'AdService.ad_id' => $ad_id,
'conditions' => [
'NOT' => [
'OR' => [
'Agent.cv' => null,
'Agent.image' => null,
]
],
'Agent.cv_dir' => null,
'Agent.image_dir' => null
],
<?php
if (!empty($this->request->query['tr']))
{
$this->Cookie->write('tr', $this->request->query['tr'], true, '30 day');
}
else
{
if ($this->Cookie->check('tr'))
{
<?php
use Cake\Routing\Router;
Router::plugin('Administration', function ($routes) {
$routes->connect('/', ['controller' => 'Users', 'action' => 'login']);
$routes->fallbacks();
});
<?php
$agent = $this->Agents->patchEntity($agent, $this->request->data(), [
'associated' => [
'Users' => [
'validate' => 'signUp'
]
],
'validate' => 'signUp'
]);
<?php
public function zipcodeToRegion($zipcode, $zipcodeField = 'id', $regionField = 'id')
{
$result = $this
->find()
->select($regionField)
->join([
[
'table' => 'provinces',
<?php
public function zipcodeToRegion($zipcode, $zipcodeField = 'id', $regionField = 'id')
{
$result = $this
->find()
->select($regionField)
->join([
[
'table' => 'provinces',