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 | |
// File: /app/Model/AppModel.php --> | |
App::uses('Model', 'Model'); | |
/** | |
* Application model for Cake. | |
* | |
* Add your application-wide methods in the class below, your models | |
* will inherit them. |
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 | |
array( | |
'Client' => array( | |
'id' => '2', | |
'name' => 'C&B Operations', | |
'contactname' => '' | |
), | |
'Job' => array( | |
(int) 0 => array( | |
'client_id' => '2', |
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 | |
// app/Model/User.php | |
App::uses('AppModel', 'Model'); | |
App::uses('SimplePasswordHasher', 'Controller/Component/Auth'); | |
class User extends AppModel | |
{ | |
public $validate = array( | |
'username' => array( |
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 | |
// app/Controller/DashboardsController.php | |
App::uses('AppController', 'Controller'); | |
class DashboardsController extends AppController | |
{ | |
public function index() | |
{ |
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 | |
// File: /app/Controller/ClientsController.php | |
App::uses('AppController','Controller'); | |
class ClientsController extends AppController | |
{ | |
// Load the Html and Form Helper: | |
public $helpers = array('Html', 'Form'); |
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 | |
echo $this->Html->link( | |
'Add New Job', | |
'/jobs/add', | |
array( | |
'class' => 'button') | |
); | |
?> |
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 | |
// File: app/Model/Client.php | |
App::uses('AppModel','Model'); // Let cake know you need the AppModel file | |
class Client extends AppModel | |
{ | |
// Relation with Job Model ------------- | |
public $hasMany = array('Job'); |
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 | |
// app/Model/Client.php | |
App::uses('AppModel', 'Model'); | |
/** | |
* Client Model | |
* | |
* @property Contact $Contact | |
* @property Job $Job | |
*/ |
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 | |
/** | |
* view method | |
* | |
* @throws NotFoundException | |
* @param string $id | |
* @return void | |
*/ | |
public function view($id = null) { | |
if (!$this->Job->exists($id)) { |
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 | |
/** | |
* Components | |
* | |
* @var array | |
*/ | |
public $components = array('Paginator', 'Session'); | |
public $pagiante = array( | |
'order' => array( | |
'Job.id' => 'desc' |
OlderNewer