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
//Router wyglada tak | |
Router::connect( | |
'/forum/:id-:slug', // E.g. /blog/3-CakePHP_Rocks | |
array('controller' => 'forum', 'action' => 'show'), | |
array( | |
// order matters since this will simply map ":id" to $articleId in your action | |
'pass' => array('id', 'slug'), | |
'id' => '[0-9]+' | |
) | |
); |
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
//routes.php | |
Router::connect( | |
'/forum/:id-:slug/*', // E.g. /blog/3-CakePHP_Rocks | |
array('controller' => 'forum', 'action' => 'show'), | |
array( | |
// order matters since this will simply map ":id" to $articleId in your action | |
'pass' => array('id', 'slug'), | |
'id' => '[0-9]+' | |
) | |
); |
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
//debug | |
array( | |
(int) 0 => array( | |
'Theard' => array( | |
'id' => '1', | |
'name' => 'Pierwszy post testowy 1', | |
'slug' => 'pierwszy-post-testowy-1', | |
'body' => 'body', | |
'by' => 'PerfectM', | |
'date' => '2013-10-17 12:31:48', |
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
//add ctp | |
<div class="add topic form"> | |
<?php echo $this->Form->create('Theard'); ?> | |
<fieldset> | |
<legend><?php echo __('Add Topic'); ?></legend> | |
<?php | |
echo $this->Form->input('name'); | |
echo $this->Form->input('Post.body'); | |
?> | |
</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
//Theard | |
public $validate = array( | |
'name' => array( | |
'notEmpty' => array( | |
'rule' => array('notEmpty'), | |
//'message' => 'Your custom message here', | |
//'allowEmpty' => false, | |
//'required' => false, | |
//'last' => false, // Stop validation after this rule | |
//'on' => 'create', // Limit validation to 'create' or 'update' operations |
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
public function beforeFilter() { | |
parent::beforeFilter(); | |
$this->Auth->allow('initDB'); // We can remove this line after we're finished | |
} | |
public function initDB() { | |
$group = $this->User->Group; | |
// Allow admins to everything | |
$group->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
$tickets object Ticket (20) | |
object (20) | |
Available methods (165) | |
Static class properties (10) | |
protected connection -> NULL | |
protected table -> NULL |
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
@extends('layout') | |
@section('content') | |
@foreach($tickets as $ticket) | |
{{ $ticket->id }} | |
@endforeach | |
@stop |
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
$tickets object Ticket (20) | |
object (20) | |
Available methods (165) | |
Static class properties (10) | |
protected connection -> NULL | |
protected table -> NULL |
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
Machine({ | |
id: 'toggle', | |
initial: 'inactive', | |
states: { | |
inactive: { on: { TOGGLE: 'active' } }, | |
active: { on: { TOGGLE: 'inactive' } } | |
} | |
}) |
OlderNewer