フォームの各項目を取得
$controller =& $this->backend->getController();
$array = $controller->getActionForm();
エラーメッセージのリスト:$this->ae->getErrorList()
foreach ($this->ae->getErrorList() as $error) {
// 項目名
echo $array->form[$error['name']]['name'];
// エラーメッセージ
echo $error['object'];
}
cf.Ethna_ActionError.php
Ethna外でのfunctionからEthnaの設定ファイルを取得する場合
$ctl = $GLOBALS['_Ethna_controller'];
$config = $ctl->getConfig();
$config->get('xxx');
これでconfig内容が取得できます
heteml でこんなエラーが出た
char_set が効いてないっぽい
hetemlはMySQL - 4.0.25-standard
system/database/DB_driver.php の 174-186をコメントアウト
/*
if (! $this->db_set_charset($this->char_set, $this->dbcollat))
{
log_message('error', 'Unable to set database connection charset: '.$this->char_set);
if ($this->db_debug)
{
$this->display_error('db_unable_to_set_charset', $this->char_set);
}
return FALSE;
}
*/
これでMySQLが使えるようになった
ここからアーカイブをダウンロード&展開
maple-3.1.0\htdocs の htdocs がApacheのドキュメントルートに来るようにすれば分かりやすい。
maple-3.1.0\htdocs\example1.php が動作サンプルになります。
ここにアクセスしても画面が正常に動かないのでSmarty版に修正します。
1)example1.php をテキストエディタで開いて以下のように書き換えます
45行目あたり
define('DEFAULT_ACTION', 'examples_simple_example1_page1');
//define('DEFAULT_ACTION', 'examples_smarty_example1_page1');
//define('DEFAULT_ACTION', 'examples_flexy_example1_page1');
↓
//define('DEFAULT_ACTION', 'examples_simple_example1_page1');
define('DEFAULT_ACTION', 'examples_smarty_example1_page1');
//define('DEFAULT_ACTION', 'examples_flexy_example1_page1');
2)Smarty本家サイトより最新版をダウンロードして解凍する。
Smarty/libs の中を全部 maple-3.1.0\maple\smarty にコピーする
ブラウザから再度アクセスすれば正常に表示されます。
詳しい設定は maple-3.1.0\webapp\config\maple.inc.php に書いてあります。