本文整理汇总了PHP中Line::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Line::delete方法的具体用法?PHP Line::delete怎么用?PHP Line::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Line
的用法示例。
在下文中一共展示了Line::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
include 'inc/init.php';
fAuthorization::requireLoggedIn();
fRequest::overrideAction();
$action = fRequest::getValid('action', array('list', 'add', 'edit', 'delete', 'view'));
$line_id = fRequest::get('line_id', 'integer');
$graph_id = fRequest::get('graph_id', 'integer');
if ('delete' == $action) {
$class_name = 'Line';
try {
$obj = new Line($line_id);
$graph = new Graph($obj->getGraphId());
$delete_text = 'Are you sure you want to delete the line : <strong>' . $obj->getAlias() . '</strong>?';
if (fRequest::isPost()) {
fRequest::validateCSRFToken(fRequest::get('token'));
$obj->delete();
fMessaging::create('success', Graph::makeUrl('edit', $graph), 'The line for ' . $graph->getName() . ' was successfully deleted');
fURL::redirect(Graph::makeUrl('edit', $graph));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', Graph::makeUrl('edit', $graph), 'The line requested could not be found');
fURL::redirect(Graph::makeUrl('edit', $graph));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/delete.php';
// --------------------------------- //
} elseif ('edit' == $action) {
try {
$line = new Line($line_id);
$graph = new Graph($line->getGraphId());
示例2: dirname
<?php
include dirname(__FILES__) . '/inc/init.php';
fAuthorization::requireLoggedIn();
fRequest::overrideAction();
$action = fRequest::getValid('action', array('list', 'add', 'edit', 'delete', 'view'));
$line_id = fRequest::get('line_id');
$graph_id = fRequest::get('graph_id');
if ('delete' == $action) {
try {
$line = new Line($line_id);
$graph = $line->createGraph();
if (fRequest::isPost()) {
fRequest::validateCSRFToken(fRequest::get('token'));
$line->delete();
fMessaging::create('success', Graph::makeUrl('edit', $graph), 'The line for ' . $graph->getName() . ' was successfully deleted');
fURL::redirect(Graph::makeUrl('edit', $graph));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', Graph::makeUrl('edit', $graph), 'The line requested could not be found');
fURL::redirect(Graph::makeUrl('edit', $graph));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/delete_line.php';
// --------------------------------- //
} elseif ('edit' == $action) {
try {
$line = new Line($line_id);
$graph = new Graph($line->getGraphId());
if (fRequest::isPost()) {