Package - single page form submit gives page not found
Permalink
Hello all
This is something that's been discussed elsewhere but I can't find a solution.
I'm writing a package which creates a single page at /dashboard/package/configure. I have view.php at /packages/package/single_pages/dashboard/package/configure/view.php which has a form, which has this action:
I've got a controller with the updateconfig() function located at /packages/package/single_pages/dashboard/clickheat/configure/controller.php.
When I submit the form I get Page Not Found. I've cleared the site's cache and disabled it but that didn't help.
Can anyone help?
This is something that's been discussed elsewhere but I can't find a solution.
I'm writing a package which creates a single page at /dashboard/package/configure. I have view.php at /packages/package/single_pages/dashboard/package/configure/view.php which has a form, which has this action:
<?php echo $this->url('/dashboard/package/configure', 'updateconfig'); ?>
I've got a controller with the updateconfig() function located at /packages/package/single_pages/dashboard/clickheat/configure/controller.php.
When I submit the form I get Page Not Found. I've cleared the site's cache and disabled it but that didn't help.
Can anyone help?
Thanks for your reply.
I'm still have no luck.
Here are the locations of the view and controller:
/packages/clickheat/single_pages/dashboard/clickheat/configure/view.php
/packages/clickheat/controllers/dashboard/clickheat/configure/controller.php
(I tried putting the controller in /packages/pages/controllers/dashboard/clickheat/configure/ as you suggested but that didn't work)
View.php contains the action in the OP (I agree with you that $this->action() is simpler, i just tried it both ways to see if it made any difference).
Controller.php contains this:
Seems pretty straightforward :/
I'm still have no luck.
Here are the locations of the view and controller:
/packages/clickheat/single_pages/dashboard/clickheat/configure/view.php
/packages/clickheat/controllers/dashboard/clickheat/configure/controller.php
(I tried putting the controller in /packages/pages/controllers/dashboard/clickheat/configure/ as you suggested but that didn't work)
View.php contains the action in the OP (I agree with you that $this->action() is simpler, i just tried it both ways to see if it made any difference).
Controller.php contains this:
class DashboardConfigureClickheatController extends Controller { public function updateconfig(){ ... do stuff ... } }
Seems pretty straightforward :/
hey,
the class should be
DashboardClickheatConfigureController
not
DashboardConfigureClickheatController
the class should be
DashboardClickheatConfigureController
not
DashboardConfigureClickheatController
I'm same issues with my website.
If hit the submit button I received "page not found"
but I'm using a normal block/form on default page.
Pretty URL Is enabled and working!
If hit the submit button I received "page not found"
but I'm using a normal block/form on default page.
Pretty URL Is enabled and working!
a couple things. First, to immediately solve your problem, the controller.php file must be in /packages/pages/controllers/dashboard/clickheat/configure/controller.php, with a class name of DashboardClickheatConfigureController
next, for the way you're calling the form- you can do echo $this->action('updateconfig') which much simpler to remember/type.