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
public function edit_sheet($id){ | |
$this->loadModel('FormSections'); | |
$this->loadModel('FormItems'); | |
$this->loadModel('FormElements'); | |
$form = $this->Form->get($id); | |
$formsections = $this->FormSections->find('all')->where(['form_id' => $id]); | |
$formitems = $this->FormItems->find('all'); | |
$formelements = $this->FormElements->find('all'); | |
$this->set('form', $form); | |
$this->set('formsections', $formsections); |
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
<? | |
namespace App\Model\Table; | |
use Cake\ORM\Table; | |
use Cake\Validation\Validator; | |
class ChatMessagesTable extends Table { | |
public function initialize(array $config) { | |
$this->belongsTo('Users'); | |
} |
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 | |
namespace App\Controller; | |
use App\Controller\AppController; | |
class ChatController extends AppController | |
{ | |
public function messages(){ | |
$this->loadModel('ChatMessages'); |
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
<? | |
namespace App\Model\Table; | |
use Cake\ORM\Table; | |
use Cake\Validation\Validator; | |
class ChatMessagesTable extends Table { | |
public function initialize(array $config) { | |
$this->belongsTo('Users'); | |
} |
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
public function messages(){ | |
$this->loadModel('ChatMessages'); | |
$this->loadModel('Users'); | |
$this->layout="json"; | |
//$this->autoRender = false; | |
//$this->viewClass = 'Tools.Ajax'; | |
//$this->RequestHandler->renderAs($this, 'json'); | |
$users = $this->Users->find('all'); | |
$chatMessages = $this->ChatMessages->find('all',[ |
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
<? | |
namespace App\Controller; | |
use App\Controller\AppController; | |
use Cake\Error\NotFoundException; | |
use Cake\Event\Event; | |
use Cake\Utility\Debugger; | |
use Cake\Utility\Inflector; | |
class UsersController extends AppController { |
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 | |
/** | |
* 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) |