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 | |
class UsersController extends AppController { | |
var $name = 'Users'; | |
var $helpers = array('Html', 'Form'); | |
function index() { | |
$this->User->recursive = 0; | |
$this->set('users', $this->paginate()); | |
} |
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
<div class="users index"> | |
<h2><?php __('Users');?></h2> | |
<p> | |
<?php | |
echo $paginator->counter(array( | |
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) | |
)); | |
?></p> | |
<table cellpadding="0" cellspacing="0"> | |
<tr> |
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
<div class="users view"> | |
<h2><?php __('User');?></h2> | |
<dl><?php $i = 0; $class = ' class="altrow"';?> | |
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt> | |
<dd<?php if ($i++ % 2 == 0) echo $class;?>> | |
<?php echo $user['User']['id']; ?> | |
| |
</dd> | |
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt> | |
<dd<?php if ($i++ % 2 == 0) echo $class;?>> |
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
<div class="users form"> | |
<?php echo $form->create('User');?> | |
<fieldset> | |
<legend><?php __('Add User');?></legend> | |
<?php | |
echo $form->input('username'); | |
echo $form->input('password'); | |
?> | |
</fieldset> | |
<?php echo $form->end('Submit');?> |
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
<div class="users form"> | |
<?php echo $form->create('User');?> | |
<fieldset> | |
<legend><?php __('Edit User');?></legend> | |
<?php | |
echo $form->input('id'); | |
echo $form->input('username'); | |
echo $form->input('password'); | |
?> | |
</fieldset> |
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
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'osaka', '', NOW()); | |
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'kyoto', '', NOW()); | |
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'hyogo', '', NOW()); | |
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'nara', '', NOW()); | |
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'wakayama', '', NOW()); | |
INSERT INTO `users` (`id`, `username`, `password`, `created`) VALUES(NULL, 'mie', '', NOW()); |
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 | |
class Post extends AppModel { | |
var $name = 'Post'; | |
var $validate = array( | |
'user_id' => array('numeric'), | |
'title' => array('notempty') | |
); | |
//The Associations below have been created with all possible keys, those that are not needed can be removed |
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 | |
class Tag extends AppModel { | |
var $name = 'Tag'; | |
var $validate = array( | |
'name' => array('notempty') | |
); | |
//The Associations below have been created with all possible keys, those that are not needed can be removed | |
var $hasAndBelongsToMany = array( |