1
votes

I'm running a Zend Framework app on my.phpcloud.com (so server configs should be ok...)

The index page works fine, I modified application/controllers/IndexController.php like this:

class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->view->assign('hello', 'hello world!');
    }
}

in application/views/scripts/index/index.phtml I print $this->hello and everything works fine.

But if I create a new controller like application/controllers/UserController.php

class UserController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->view->assign('name', 'Albert');
    }
}

I created the view in application/views/scripts/user/index.phtml and I print $this->name as I did in the index's view.

But when i visit http://myapp/user I get a Not Found error...what's the problem?

1
Check your reWrite rule (.htaccess) framework.zend.com/manual/1.12/en/…opHASnoNAME
My bootstrap.php is empty, what i should write in it?Alberto Nicoletti
its ok when it is empty ;) you need only when you have to bootstrap stuff on you ownopHASnoNAME

1 Answers

1
votes

1) Check that the file name for user controller contains first uppercase letter UserController.php (not userController.php)

2) Check .htaccess file for proper rewrite rulles

3) Try http://myapp/User (User uppercase first letter)

4) Check that default routing is enabled.

5) Do you have error controller created and enabled?

I think that there is some problem in configuration, maybe in your bootstrap or in config.ini