Ethna
提供:senooken JP Wiki
About
PHPのMVC系のフレームワーク。
開発終了済み。
動作概要 - Ethna - PHPウェブアプリケーションフレームワーク
最新版はv2.6だが文書類が放棄されている。
v2.5系の古い公式サイト「PukiWiki」の方が文書が整理されているので、これを参考にする。
Tutorial
Action/View/Template
2. アクション、ビュー、テンプレートの作成と処理の流れ — Ethna 2.6 documentation
actionクラス内にフォーム定義のActionFormと実際の処理のActionClassを記載する。
<?php
class Miniblog_Form_Hello extends Miniblog_ActionForm
{
protected $form = array(
);
}
class Miniblog_Action_Hello extends Miniblog_ActionClass
{
public function prepare()
{
return null;
}
public function perform()
{
return 'hello';
}
}
prepareでバリデーション系処理を行い、performで実処理を行う。
returnで遷移先の画面名のstringを返す。
prepareでreturn null以外が返ると、performは実行されずに終わる。
ActionClassはクラス名の命名規則から該当するActionFormのプロパティーのデータを保有している模様。
Debug
Ethna でのログ出力を制御する - Ethna - PHPウェブアプリケーションフレームワーク
logging
Ethna_Loggerクラスを使ってログを管理している。
