admin_add_newsletter.ctp
foreach($menu_page_1 as $menu_pages) {
echo $this->Form->checkbox('top_links.',array(
'type'=>'checkbox','id'=>'checked_box',
'value'=>$menu_pages['MenuPage']['id'],
'label'=>false,'div'=>false,'hiddenField'=>false,
'saparator'=>'</td><td>'
));
echo '<label for="top_links'.$menu_pages['MenuPage']['id'].'">'.
$menu_pages['MenuPage']['name'].'</label>';
}
通讯控制器.php
if($this->request->is('post')) {
print_r($this->data['Newsletter']['top_links']['']);
exit();
}
错误
The request has been black-holed
Error: The requested address '/admin/newsletters/add_newsletter' was not found on this server.
Stack Trace
CORE/Cake/Controller/Component/SecurityComponent.php line 239 → SecurityComponent->blackHole(NewslettersController, string)
[internal function] → SecurityComponent->startup(NewslettersController)
CORE/Cake/Utility/ObjectCollection.php line 132 → call_user_func_array(array, array)
[internal function] → ObjectCollection->trigger(CakeEvent)
CORE/Cake/Event/CakeEventManager.php line 247 → call_user_func(array, CakeEvent)
CORE/Cake/Controller/Controller.php line 675 → CakeEventManager->dispatch(CakeEvent)
CORE/Cake/Routing/Dispatcher.php line 182 → Controller->startupProcess()
CORE/Cake/Routing/Dispatcher.php line 160 → Dispatcher->_invoke(NewslettersController, CakeRequest, CakeResponse)
APP/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)
帮助我了解如何在 cakephp 中使用复选框,其中包含从视图文件到控制器的所有检查值,而不会显示黑洞错误。