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


PHP Flux::Message方法代码示例

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


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

示例1: trim

    exit;
}
$title = Flux::message('NewsAddTitle');
// Form values.
$news = Flux::config('FluxTables.CMSNewsTable');
$title = trim($params->get('news_title'));
$body = trim($params->get('news_body'));
$link = trim($params->get('news_link'));
$author = trim($params->get('news_author'));
if (count($_POST)) {
    if ($title === '') {
        $errorMessage = Flux::Message('XCMSNewsTitleError');
    } elseif ($body === '') {
        $errorMessage = Flux::Message('XCMSNewsBody');
    } elseif ($author === '') {
        $errorMessage = Flux::Message('XCMSNewsAuthor');
    } else {
        if ($link) {
            if (!preg_match('!^http://!i', $link)) {
                $news_link = "http://{$link}";
            }
        }
        $sql = "INSERT INTO {$server->loginDatabase}.{$news} (title, body, link, author, created, modified)";
        $sql .= "VALUES (?, ?, ?, ?, NOW(), NOW())";
        $sth = $server->connection->getStatement($sql);
        $sth->execute(array($title, $body, $link, $author));
        $session->setMessageData(Flux::message('XCMSNewsAdded'));
        if ($auth->actionAllowed('news', 'index')) {
            $this->redirect($this->url('news', 'index'));
        } else {
            $this->redirect();
开发者ID:mleo1,项目名称:rAFluxCP,代码行数:31,代码来源:add.php

示例2: trim

$sql = "SELECT id, title, path, body, modified FROM {$server->loginDatabase}.{$pages} WHERE id = ?";
$sth = $server->connection->getStatement($sql);
$sth->execute(array($id));
$page = $sth->fetch();
if ($page) {
    $title = $page->title;
    $path = $page->path;
    $body = $page->body;
    if (count($_POST)) {
        $title = trim($params->get('page_title'));
        $path = trim($params->get('page_path'));
        $body = trim($params->get('page_body'));
        if ($title === '') {
            $errorMessage = Flux::Message('XCMSPageTitleError');
        } elseif ($path === '') {
            $errorMessage = Flux::Message('XCMSPagePathError');
        } elseif ($body === '') {
            $errorMessage = Flux::Message('XCMSPageBodyError');
        } else {
            $sql = "UPDATE {$server->loginDatabase}.{$pages} SET title = ?, path = ?, body = ?, modified = NOW() WHERE id = ?";
            $sth = $server->connection->getStatement($sql);
            $sth->execute(array($title, $path, $body, $id));
            $session->setMessageData(Flux::message('XCMSPageUpdated'));
            if ($auth->actionAllowed('pages', 'index')) {
                $this->redirect($this->url('pages', 'index'));
            } else {
                $this->redirect();
            }
        }
    }
}
开发者ID:mleo1,项目名称:rAFluxCP,代码行数:31,代码来源:edit.php


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