====== 10 Zend Framework ====== ====== リファレンス ====== [[http://www.zendframework.com/manual/ja/manual.html]] ====== インストール ====== ===== ダウンロード ===== [[http://framework.zend.com/download]] ※無料の登録が必要です。 今回はコレを使用しました。 ZendFramework-1.10.3.tar.gz 解凍して、/usr/localあたりに置いておく # tar zxv ZendFramework-1.10.3.tar.gz # cp -rf ZendFramework-1.10.3 /usr/local/ZendFramework ===== php.iniの編集 ===== include_pathにコピーしたパス「/usr/local/ZendFramework/library」を追加する。 include_path = ".:/php/includes:/usr/local/ZendFramework/library" ===== Apacheの再起動 ===== # /etc/init.d/httpd restart ====== Hello Worldを出してみる ====== 今回は例として「/home/matsui」ディレクトリに設置します。 [[#インストール]] 上記の方法でインストール済みとして説明します。 ApacheのDocumentRootは「/home/matsui/public_html」です。 /home/matsui/ | |__ZendApp/ | |__controllers/ | | | | | |__HelloController.php | | | |__models/ | | | |__views/ | | | |__scripts/ | | | |__hello/ | | | |__index.phtml |__public_html/ | |__index.php |__.htaccess ===== public_html/index.php ===== ===== public_html/.htaccess ===== php_flag magic_quotes_gpc off RewriteEngine on RewriteBase / RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php ===== ZenApp/controllers/HelloController.php ===== view->assign('hoge', 'Hello, World'); echo $this->render('index'); } } ?> ===== ZenApp/scripts/hello/index.phtml ===== Hello, World!

hoge; ?>

ZendFrameworkのテストです。
===== Webでアクセス ===== http://[IP や VirtualName]/helo/ {{tag>php framework}}