I have now been searching the internet high and low for a few weeks in hope of finding the answer I require to my Smarty / Modules problem with Zend. As always if you come to SitePoint you get help unlike others... Please bare with me on this one...
Basically, I am trying to create a module called courses so the end url would bewhich I think is a pretty simple task.Code:
My application Structure is as follows:
Then the in the BootStrap (index.php) in public_html I haveCode:
Problem: When I goto http://domain.com/courses it seems to be showing the main front page from my templates folder (/public_html/templates/index/index.tpl)Code:
$controller = Zend_Controller_Front::getInstance();
'default' => $config->paths->base . 'include/Controllers',
'courses' => $config->paths->base . 'include/Courses/Controllers'
$vr = new Zend_Controller_Action_Helper_ViewRenderer();
$router = $controller->getRouter();
$router->addConfig(new Zend_Config_Ini('../include/Configuration/routes.ini', 'routes'), 'routes');
I have spoken to Mr. Zervass from PHPRiot who's book I'm reading & he told me to add a route:
I have tried and tried on this for around 2 weeks now everynight and still can't seem to get it to work -Quote:
routes.course.route = "courses/:url/:action/*"
routes.course.defaults.module = courses
routes.course.defaults.controller = course
routes.course.defaults.action = index
Example uses modules as well as controllers and action (effectively adding an extra level of grouping the actions)
This basically means if the "action" parameter is blank then "index" is used.
This class is then declared as:
class Courses_CourseController extends CustomControllerAction
I can understand-ish why it's showing the index/index template and not courses/index.tpl template but nothing I try seems to fix it.
Is it possible to use CourseController.php as the default in the courses folder instead of IndexController.php ref: "routes.course.defaults.controller = course" ? confused
Hoping someone can shed light on this for me....