Kohanaで入力→確認→完了までを作ってみた
ユーザーの登録~完了まで。
入力項目は名前とmailアドレス。
guesswork利用した時と似た感じになった。
自分がやりやすいからだと思うのだけど、これ正しいやり方?
CodeIgniter利用しても似た感じになるのかなー。
テンプレートエンジンにPHPTAL使ったのでview系のヘルパーは一切利用してません。
■コントローラ
・/application/controllers/reg.php
<?php defined(’SYSPATH’) or die(’No direct script access.’);
class Reg_Controller extends Controller {
function __construct()
{
parent::__construct();
$this->validation->error_format(’{message}’);
}
function index($status=’init’)
{
$fields = array(’username’, ‘mail’, ‘mail_confirm’);
$methodName = sprintf(’index_%s’, $status);
if (!method_exists($this, $methodName)) {
[…]
Posted on 2月 6th, 2008 by t
Filed under: PHPTAL, Kohana | No Comments »
