Dashboard Single Page build issues
Permalink
So I am trying to make a single page in the dashboard and I have everything working in the view except that when I submit the form it gives me a 404 Page Not Found error. I have my code below...
Controller
View
File Structure
controllers/dashboard/email_blast/controller.php
single_pages/dashboard/email_blast/view.php
Controller
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class DashboardEmailBlastController extends Controller { private function __construct(){} public function view(){ } public function send_emails(){ $group = $this->post('group'); $this->set('group', $this->post('group')); $this->view(); } public function add(){ } }
View
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $h = Loader::helper('concrete/interface'); $f = Loader::helper('form'); Loader::element('editor_config'); echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Email Blast')); $user_select = Loader::helper('form/user_selector'); $groups = Loader::model('groups'); $gl = new GroupList($groups, array('Guest'), true); $groupArray = array(); ?> <form method="post" action="<?php echo $this->action('send_emails') ?>"> <h3>Select Group to Email</h3> <?php foreach($gl->getGroupList() as $g){
Viewing 15 lines of 35 lines. View entire code block.
File Structure
controllers/dashboard/email_blast/controller.php
single_pages/dashboard/email_blast/view.php
![ScottSandbakken](/files/avatars/92226.jpg)
Clear your cache.
All ready gave that a shot. But thanks!
I'm not sure about this but I don't think you need the $this->view within the send_emails function.
also instead of
also instead of
function send_emails() //try function action_send_emails()
Ok, I found the issue. I don't think that you can print out information in the function because then it tries to render a page that hasn't been registered as a single page. Thanks for the help everyone!