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


PHP Quote::newQuote方法代码示例

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


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

示例1: User

require_once "../models/Base.php";
require_once "../models/User.php";
require_once "../models/Quote.php";
// $user = new User;
$user = new User();
$quote = new Quote();
$user->migrate();
$quote->migrate();
if (isset($_SERVER["SERVER_NAME"])) {
    die("This script must be run from the command line.");
}
require "../db/bootstrap.php";
print "Initializing the quotes database...";
$first = $quote->findByQuote($quotes[0]["quote"]);
if ($first) {
    print " (already filled) ";
} else {
    foreach ($quotes as $q) {
        $quote->newQuote($q["who"], $q["quote"], 1);
    }
}
print "done\n\n";
$stdin = fopen("php://stdin", "r");
print "Let's create a new user\n";
print "Please enter the administrator's email: ";
$email = trim(fgets($stdin));
print "Administrator's password: ";
$password = trim(fgets($stdin));
$user->newUser($email, $password, 1);
fclose($stdin);
开发者ID:kastner,项目名称:inspiration,代码行数:30,代码来源:initialize.php

示例2: Quote

<?php

if ($_POST["quote"] && $_POST["who"]) {
    require_once "../models/Base.php";
    require_once "../models/Quote.php";
    $quote = new Quote();
    $quote->newQuote($_POST["who"], strip_tags($_POST["quote"]));
    $message = "Your quote has been added, thank you. " . $_POST["who"];
}
$title = "Add a quote";
require "header.php";
?>

<?php 
if ($message) {
    ?>
<h1><?php 
    echo $message;
    ?>
</h1>
<?php 
}
?>

<?php 
require "form.php";
?>

<?php 
require "footer.php";
开发者ID:kastner,项目名称:inspiration,代码行数:30,代码来源:add.php


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