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


PHP Line::getAlias方法代码示例

本文整理汇总了PHP中Line::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Line::getAlias方法的具体用法?PHP Line::getAlias怎么用?PHP Line::getAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Line的用法示例。


在下文中一共展示了Line::getAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cloneLine

 public static function cloneLine($line_id, $ignore_clone_name = FALSE, $graph_id = NULL)
 {
     $line_to_clone = new Line($line_id);
     if (empty($graph_id)) {
         $graph_id = $line_to_clone->getGraphId();
     }
     $line = new Line();
     if ($ignore_clone_name) {
         $clone_alias = $line_to_clone->getAlias();
     } else {
         $clone_alias = 'Clone of ' . $line_to_clone->getAlias();
         // If it's too long, we truncate
         if (strlen($clone_alias) > 255) {
             $clone_alias = substr($clone_alias, 0, 255);
         }
     }
     $line->setAlias($clone_alias);
     $line->setTarget($line_to_clone->getTarget());
     $line->setColor($line_to_clone->getColor());
     $line->setGraphId($graph_id);
     $line->setWeight($line_to_clone->getWeight());
     $line->store();
 }
开发者ID:nagyist,项目名称:Tattle,代码行数:23,代码来源:Line.php

示例2: catch

            fRequest::validateCSRFToken(fRequest::get('token'));
            $line->store();
            fMessaging::create('affected', fURL::get(), $graph->getName());
            fMessaging::create('success', fURL::getWithQueryString(), 'The Line ' . $line->getAlias() . ' was successfully updated');
        }
    } catch (fNotFoundException $e) {
        fMessaging::create('error', Graph::makeUrl('edit', $graph), 'The Line requested, ' . fHTML::encode($line_id) . ', could not be found');
        fURL::redirect(Graph::makeUrl('edit', $graph));
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/add_edit_line.php';
    // --------------------------------- //
} elseif ('add' == $action) {
    $line = new Line();
    $graph = new Graph($graph_id);
    if (fRequest::isPost()) {
        try {
            $line->populate();
            fRequest::validateCSRFToken(fRequest::get('token'));
            $line->store();
            $graph_url = Graph::makeUrl('edit', $graph);
            fMessaging::create('affected', $graph_url, $line->getAlias());
            fMessaging::create('success', $graph_url, 'The Line ' . $line->getAlias() . ' was successfully created');
            fURL::redirect($graph_url);
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_line.php';
}
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:31,代码来源:lines.php


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