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
-- | |
-- テーブルの構造 `users` | |
-- | |
CREATE TABLE `users` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`username` varchar(20) COLLATE utf8_unicode_ci NOT NULL, | |
`password` char(40) COLLATE utf8_unicode_ci NOT NULL, | |
`created` datetime DEFAULT NULL, | |
PRIMARY KEY (`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 | |
class AppController extends Controller { | |
var $components = array('DebugKit.Toolbar'); | |
} | |
?> |
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="posts form"> | |
<?php echo $form->create('Post');?> | |
<fieldset> | |
<legend><?php __('Edit Post');?></legend> | |
<?php | |
echo $form->input('id'); | |
echo $form->input('title'); | |
echo $form->input('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
<div class="posts form"> | |
<?php echo $form->create('Post');?> | |
<fieldset> | |
<legend><?php __('Add Post');?></legend> | |
<?php | |
echo $form->input('title'); | |
echo $form->input('body'); | |
?> | |
</fieldset> | |
<?php echo $form->end('Submit');?> |
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="posts view"> | |
<h2><?php __('Post');?></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 $post['Post']['id']; ?> | |
| |
</dd> | |
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt> | |
<dd<?php if ($i++ % 2 == 0) echo $class;?>> |
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="posts index"> | |
<h2><?php __('Posts');?></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 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 PostsController extends AppController { | |
var $name = 'Posts'; | |
var $helpers = array('Html', 'Form'); | |
function index() { | |
$this->Post->recursive = 0; | |
$this->set('posts', $this->paginate()); | |
} |
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 | |
class DATABASE_CONFIG { | |
var $default = array( | |
'driver' => 'mysql', | |
'persistent' => false, | |
'host' => 'localhost', | |
'login' => 'user', | |
'password' => 'pass', | |
'database' => 'workshop', |
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
INSERT INTO posts (title, body, created) VALUES ('大阪', 'これは、記事の本文でっせー。', NOW()); | |
INSERT INTO posts (title, body, created) VALUES ('また大阪か', 'そこに本文が続きまんがな。', NOW()); | |
INSERT INTO posts (title, body, created) VALUES ('大阪の逆襲', 'こりゃほんまおもろいで!って、うそやねん〜', NOW()); |
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
-- | |
-- テーブルの構造 `posts` | |
-- | |
CREATE TABLE `posts` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`title` varchar(50) COLLATE utf8_unicode_ci NOT NULL, | |
`body` text COLLATE utf8_unicode_ci NOT NULL, | |
`created` datetime DEFAULT NULL, | |
`modified` datetime DEFAULT NULL, |