当前位置: 首页>>代码示例>>PHP>>正文


PHP Line::delete方法代码示例

本文整理汇总了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());
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:30,代码来源:lines.php

示例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()) {
开发者ID:rberger,项目名称:Graphite-Tattle,代码行数:31,代码来源:lines.php


注:本文中的Line::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。