PHPフレームワーク Mapleに触れてみた
php5.2.17
maple3.2
apache2.2
1.php5 では、開発者がクラスのコンストラクタメソッドを宣言することが出来る。
ただし、子クラスがコンストラクタを有している場合、親クラスのコンストラクタ
が暗黙の内にコールされることは無い。 親クラスのコンストラクタを実行する
には、子クラスのコンストラクタの 中で parent::__construct() をコールする
ことが 必要。
Smarty4Maple.class.phpは、Smarty.class.phpを継承している。
[Smarty4Maple.class.php]
class Smarty4Maple extends Smarty
{
function __construct()
{
parent::__construct();
}
2.テンプレートファイルの置き場は、defaultでは、smartyインストールフォルダ
配下の、templatesフォルダとなっている。
変更する場合は、smartyインストールフォルダ配下のSmarty.class.phpを変更。
以下の例では、WEBAPP配下のtemplatesフォルダに変更。
// $this->template_dir = array('.' . DS . 'templates' . DS);
$this->template_dir = array(WEBAPP_DIR . DS . 'templates' . DS);
3.設定ファイル(maple.ini)のConvertセクション。入力の半角変換で
「Call to undefined function mb_convert_kana()」(apache:error.log)
php.iniの以下のコメントを外すこと。
extension=php_mbstring.dll
; Module Settings ;の [mbstring]セクションも何かしないと駄目だ。