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
root@vmi2495:/etc/nginx/sites-enabled# cat test.it | |
server { | |
listen 80; | |
server_name test.it; | |
rewrite ^(.*) http://www.test.it$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name www.test.it; |
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 | |
/** | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* | |
* Licensed under The MIT License | |
* For full copyright and license information, please see the LICENSE.txt | |
* Redistributions of files must retain the above copyright notice. | |
* | |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
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 | |
/** | |
* Routes configuration | |
* | |
* In this file, you set up routes to your controllers and their actions. | |
* Routes are very important mechanism that allows you to freely connect | |
* different urls to chosen controllers and their actions (functions). | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
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
class AppController extends Controller { | |
public $components = array( | |
'Session', | |
'Cookie', | |
'Auth' => array( | |
'authenticate' => array( | |
'Form' => array( | |
'userModel' => 'Member', | |
'fields' => array('username' => 'pseudo', 'password' => 'password') | |
) |
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 | |
use Cake\Core\Plugin; | |
use Cake\Routing\Router; | |
Router::defaultRouteClass('Route'); | |
$languageCodes = array('fr_FR', 'pt_BR'); | |
$builder = function ($routes) { | |
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
$query = $this->Articles->find('all') | |
->leftJoinWith('ArticlesAuthors') | |
->leftJoinWith('Authors') | |
->where(['Authors.id' => 1]) | |
->orWhere(['ArticlesAuthors.author_id' => 1]); |
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
Table | |
public function validationDefault(Validator $validator) | |
{ | |
$validator | |
->requirePresence('device_id', 'create') | |
->notEmpty('device_id'); | |
return $validator; | |
} |
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
<div class="container"> | |
<div class="form-group"> | |
<?= $this->Form->create($assessmentForm) ?> | |
<fieldset> | |
<legend><?= __($assessmentForm->title) ?></legend> | |
<?php foreach ($questions as $k => $question): ?> | |
<?php echo $this->Form->hidden("$k.qid", ['value'=> $question->qid]) ?> | |
<?php echo $this->Form->input("$k.answer_text", ['label' => $question['text']]) ?> | |
<?php endforeach; ?> | |
</fieldset> |
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 | |
if (!empty($this->request->data('applications.companies_ids'))) { | |
// Recupero gli ids delle aziende a cui l'agente si è candidato | |
$companiesIds = array_diff( | |
$this->request->data('applications.companies_ids'), | |
(new Collection($agent->applications))->extract('company_id')->toArray() | |
); | |
OlderNewer