Issue processing form on Dashboard Single Page
Permalink
I am trying to process a form on a single page on my Dashboard. I have the following code for the form and my controller:
/packages/<MyPackage>/single_pages/dashboard/<MyDashboard>/add.php
/packages/<MyPackage>/controllers/single_pages/dashboard/<MyDashboard>/add.php
When I submit my form I am redirected from:
to which I believe is correct, but I am presented a 404 error. What am I doing wrong?
/packages/<MyPackage>/single_pages/dashboard/<MyDashboard>/add.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> <h2 class="page-title">Add Number</h2> <div class="entry"> <div class="clear"></div> <form action="<?php echo $this->action('save')?>" method='POST'> <div class="form_group"> <label for="number">Number</label> <input type="text" name="number"> </div> <div class="ccm-dashboard-form-actions-wrapper"> <div class="ccm-dashboard-form-actions"> <button class="pull-right btn btn-success" type="submit" ><?=t('Save')?></button> </div> </div> </form>
Viewing 15 lines of 16 lines. View entire code block.
/packages/<MyPackage>/controllers/single_pages/dashboard/<MyDashboard>/add.php
<?php namespace Concrete\Package\Invoicing\Controller\SinglePage\Dashboard\<MyPackage>\<MyDashboard>; use \Concrete\Core\Page\Controller\DashboardPageController; use Config; use Loader; class Add extends DashboardPageController { private $_db; public function view() { $this->_db = Loader::db(); } public function save() { $number = $this->post('number'); print $number; } }
When I submit my form I am redirected from:
www.example.com/index.php/dashboard/<MyDashboard>/add
www.example.com/index.php/dashboard/<MyDashboard>/add/save