changing __construct() to init() solved my first problem, thanks..

The Routing Problem:

My dirs:

|/application
 /models
 /views
 /controllers
/httpdocs
 /images
 /styles
 .htaccess
 index.php
/library
 /Zend|


"Real" url: http://192.168.0.99/entwicklung/trunk/httpdocs/

In my bootstrap:

$router     = new Zend_Controller_RewriteRouter();
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory('./application/controllers')
          ->setRouter($router)
          ->setBaseUrl('/entwicklung/trunk/httpdocs')// set the base url!
          ->throwExceptions(true);
$response   = $controller->dispatch();

"The" Exception:

<b>Fatal error</b>:  Uncaught exception 'Zend_Controller_Dispatcher_Exception' with 
message 'Directory &quot;./application/controllers&quot; not found or not readable' in 
/var/www/entwicklung/trunk/library/Zend.php:229
Stack trace:
#0 /var/www/entwicklung/trunk/library/Zend/Controller/Dispatcher.php(160): 
Zend::exception('Zend_Controller...', 'Directory &quot;./ap...')
#1 /var/www/entwicklung/trunk/library/Zend/Controller/Front.php(699): 
Zend_Controller_Dispatcher-&gt;addControllerDirectory('./application/c...', 0)
#2 /var/www/entwicklung/trunk/application/config/settings.php(111): 
Zend_Controller_Front-&gt;dispatch()
#3 /var/www/entwicklung/trunk/httpdocs/index.php(13): 
require_once('/var/www/entwic...')
#4 {main}
 thrown in <b>/var/www/entwicklung/trunk/library/Zend.php</b> on line 
<b>229</b><br />


Before the upgrade i did it like:

$router = new Zend_Controller_RewriteRouter();
$controller = Zend_Controller_Front::getInstance();
$router->addRoute('actionroute', $route1);
$router->addRoute('404route', $route2);
$controller->setBaseUrl('/entwicklung/trunk/httpdocs');


Everything worked fine...
Any Idea?



kcrane377 schrieb:
I had the same issue with the request object not being passed to the action
on first migration. Changing the constructor to init() fixed the issue.

class IndexController extends Zend_Controller_Action
{
        public function __construct()
        {...}

        public function viewAction()
        {
                $id = $this->_getParam('id');
        }

...

change to:
class IndexController extends Zend_Controller_Action
{
        public function init()
        {...}

        public function viewAction()
        {
                $id = $this->_getParam('id');
        }
...

As far as the noRouteAction. It should not be called since its been removed. __call will handle this now. Please supply your routing method (default,
rewriterouter) info to help diagnose your routing issue.



Lindemann Medien wrote:
Hello,

I have to problems after upgrading to 0.6.0:

-        Fatal error: Call to a member function getParam() on a non-object
in /var/www/entwicklung/trunk/library/Zend/Controller/Action.php on line
302

Source Code:

 $zielgruppe_id = $this->_getParam('id');

-        The Main Page (like http://localhost/) is always routing to
/noroute.. Always.. I removed the /noroute action from my index controller
but this won´t change anything.. I saw that the routing changed a lot, I
think there is my main problem.
I looked at
http://framework.zend.com/manual/en/zend.controller.migration.html but i
don´t see the “hint” to solve my two problems..

Thanks,

Marc




Reply via email to