Second Controller method ignored- produces '404'
Permalink
In the c5 book - Concrete5 Beginner's Guide - there is a package building exercise.
All works well, except I am unable to send a value from one of the controllers to the view. Specifically, the $mode variable in the code below is not being passed to the view.
Also, if i try to access the 'all' method directly via /index.php/dashboard/reports/broken_links/all/ I get a 'Page not found' error.
It seems that the 'all' in the call is being passed to the 'view' method as a parameter
But why??
The Package controller
All works well, except I am unable to send a value from one of the controllers to the view. Specifically, the $mode variable in the code below is not being passed to the view.
Also, if i try to access the 'all' method directly via /index.php/dashboard/reports/broken_links/all/ I get a 'Page not found' error.
It seems that the 'all' in the call is being passed to the 'view' method as a parameter
But why??
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class DashboardReportsBrokenLinksController extends Controller { public $helpers = array('form', 'html'); public function view() { Loader::model('broken_links', 'c5book'); $this->set('mode', 'brokenLinks'); $this->set('links', BrokenLinks::getBrokenLinks()); } public function all() { Loader::model('broken_links', 'c5book'); $this->set('mode', 'allLinks'); $this->set('links', BrokenLinks::getAllLinks()); } }
Viewing 15 lines of 16 lines. View entire code block.
The Package controller
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class c5bookPackage extends Package { protected $pkgHandle = 'c5book'; protected $appVersionRequired = '5.4.0'; protected $pkgVersion = '1.0'; public function getPackageDescription() { return t("Theme, Templates and Blocks from Concrete5 for Beginner's"); } public function getPackageName() { return t("c5book"); } public function install() { $pkg = parent::install(); // install link checker job
Viewing 15 lines of 23 lines. View entire code block.
Have you cleared/disabled your cache? if you havn't please try that.
also, change
to
class c5bookPackage extends Package {
to
class C5bookPackage extends Package {
Good catch on the C5book... Sadly, it did not make a difference.
tried '/index.php/dashboard/reports/broken_links/all/' again with 'Page not found' response.
The attached image shows the directory structure. It seems so right, yet is is failing.
I know I must be missing something very fundamental, so I keep searching.
tried '/index.php/dashboard/reports/broken_links/all/' again with 'Page not found' response.
The attached image shows the directory structure. It seems so right, yet is is failing.
I know I must be missing something very fundamental, so I keep searching.