本文整理汇总了PHP中Layout::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::delete方法的具体用法?PHP Layout::delete怎么用?PHP Layout::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Content
<?php
$ci =& get_instance();
$id = $ci->uri->segment(5);
$c = new Content();
$c->get_by_id($id);
if ($c->exists()) {
if ($c->type == 'layout') {
$c = new Layout();
$c->get_by_id($id);
}
if ($c->can_delete()) {
$c->delete();
$ci->app->add_info('Content deleted');
} else {
$ci->app->add_error('permission denied! please check your root adminstrator');
}
} else {
$ci->app->add_error('Content not found');
}
示例2: deleteSection
/**
* Deletes multiple content layouts
*
* @return bool
*/
public function deleteSection()
{
$this->setTitle(t('Delete layouts'));
$this->setOutputType(self::_OT_CONFIG);
if ($this->_input->checkToken()) {
try {
$delCount = 0;
foreach ($this->_input->post('layout_names') as $layoutName) {
$layout = new Layout($layoutName);
if ($layout->delete()) {
$delCount++;
} else {
$this->_event->error(sprintf(t('Unable to delete layout "%1$s"'), $layoutName));
}
}
if ($delCount > 0) {
$this->_event->success(t('Deleted selected layouts'));
}
} catch (Input_KeyNoExist $e) {
$this->_event->error(t('No layouts selected'));
}
} else {
$this->_event->error(Input::csrfMsg());
}
return zula_redirect($this->_router->makeUrl('content_layout'));
}