zitter
(Zitter)
May 24, 2010, 10:52pm
1
Hi, I’m watching controllerMap component to see how it works, but for it doesn’t
I have SiteController that works. mydomain.com/Site display "hello!" message
Now, I’ve added this to config/main.php:
'controllerMap'=>array(
'node'=>array(
'class'=>'application.controllers.SiteController',
),
Looking at mydomain.com/node it showa 404 error.
Why? Of course that SiteController is under protected/controllers/ dir. I’ve tried also in string way ‘node’=>‘application.controller.SiteController’ but it doesn’t work either… any hint?
tia
Danilo
tri
(tri - Tommy Riboe)
May 24, 2010, 11:21pm
2
Hi, I’m watching controllerMap component to see how it works, but for it doesn’t
I have SiteController that works. mydomain.com/Site display "hello!" message
Now, I’ve added this to config/main.php:
'controllerMap'=>array(
'node'=>array(
'class'=>'application.controllers.SiteController',
),
Looking at mydomain.com/node it showa 404 error.
Why? Of course that SiteController is under protected/controllers/ dir. I’ve tried also in string way ‘node’=>‘application.controller.SiteController’ but it doesn’t work either… any hint?
tia
Danilo
I tested it and it works for me. ‘controllerMap’ should be placed outside of ‘components’.
/Tommy
zitter
(Zitter)
May 25, 2010, 7:47am
3
Thanks Tommy, I placed inside ‘components’ and that was the error
I can add that also views/<controller_name> have to be renamed, so I needed to change views/site to views/node to work.