Zend Server を使用して Zend MVC で Hello World プロジェクトを作成しています。ルーティングがどのように間違っているか。私は zend_tool zf.sh create project でプロジェクトを作成するので、それはすべてのディレクトリ自体を作成し、以下のようないくつかのアクションを試すために indexController に変更し、他のすべてのファイルは同じことを思い出させます..
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
$this->_helper->viewRenderer->setNoRender();
}
public function indexAction()
{
// action body
$this->getResponse()->appendBody('hello from about Action');
}
public function aboutAction()
{
$this->getResponse()->appendBody('hello from about Action');
// action body
}
}
「http://localhost/index.php」と入力すると、indexAction(); からの正しい情報が表示されます。
「http://localhost/index」と入力すると、「http://localhost/index.php/about」と入力すると
ページが見つからないと表示され
、 「メッセージ: 無効なコントローラーが指定されました (about)」と表示されます。
配列 (
'controller' => 'about',
'action' => 'index',
'module' => 'default', )
私はコントローラーがインデックスであり、アクションが約であることを期待しています..どうすれば修正できますか...
私はこれを私のApache設定に持っています。この設定が間違っている可能性があると思いますが、どこにあるのかわかりません。
<VirtualHost *:80>
#DocumentRoot "/usr/local/zend/apache2/htdocs"
DocumentRoot /home/testuser/projects/helloworldproject/public
<Directory "/home/testuser/projects/helloworldproject/public/">
SetEnv APPLICATION_ENV "development"
Order allow,deny
Allow from All
</Directory>
御時間ありがとうございます。