本文整理汇总了PHP中Card::store方法的典型用法代码示例。如果您正苦于以下问题:PHP Card::store方法的具体用法?PHP Card::store怎么用?PHP Card::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card::store方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Card
$page = 'cards';
$title = 'Add card';
$desc = '';
require '../header.php';
if (!isset($user)) {
fURL::redirect('/login.php?forward=/members/cards.php');
}
if (isset($_POST['submit'])) {
try {
fRequest::validateCSRFToken($_POST['token']);
$card = new Card();
$card->setUserId($user->getId());
$card->setAddedDate(time());
$card->setUid($_POST['uid']);
$card->store();
fURL::redirect('/members/cards.php');
exit;
} catch (fValidationException $e) {
echo "<p>" . $e->printMessage() . "</p>";
} catch (fSQLException $e) {
echo "<p>An unexpected error occurred, please try again later</p>";
trigger_error($e);
}
}
?>
<h2>Add card</h2>
<form method="POST">
<input type="hidden" name="token" value="<?php
echo fRequest::generateCSRFToken();
示例2: display
private function display()
{
if (!$this->boobool) {
//on relance la procédure de génération
$this->process();
} else {
if (isset($_POST['submit_form'])) {
if (!$this->submit || $this->errors) {
return false;
}
// insertion de la carte
$forbidden = array();
for ($i = 1; isset($this->res['tabou' . $i]); $i++) {
array_push($forbidden, $this->res['tabou' . $i]);
}
$carte = new Card($this->userlang, NULL, $this->res['nivcarte'], "nom", $this->oracle, $this->res['mot'], $forbidden, array());
$carte->store();
$this->card = $carte;
unset($this->res);
// affichage de la carte
include './views/oracle.card.display.html';
} else {
//si carte pas encore validée, c'est le premier passage dans la page : affichage de la page génération de carte
include './views/oracle.alea.html';
}
}
return true;
}
示例3: Card
header('Content-Type: text/html; charset=UTF-8');
?>
<head>
<style>.carte{float:left; padding:3px; background-color:lightgrey; margin-right:3px;display: flex;flex-direction: column;justify-content:space-between;width:250px}
.carte div{margin:0;padding-bottom:4px; padding-top:4px; padding-left:1em; padding-right:1em;}
.carte>div{padding:0;}
.langue{font-weight:bold; background-color:grey;color:white;}
.niveauMin{text-align: right; color:white; float:right; background-color:black}
.categorie{background-color:white; margin-bottom:3px}
.motCle{text-align:center}
.motATrouver{font-weight:bold; background-color:#06AD45}
.tabous{overflow:auto;height:250px}
.themes{overflow:auto;height:30px}
.carte + *:not(.carte){clear:both}
.auteur{background-color:white; text-align:left;}</style>
</head>
<body>
<?php
error_reporting(E_ALL);
//error_reporting(0); désactiver
ini_set('display_errors', '1');
require 'models/card.class.php';
$test = new Card(1);
echo $test;
$test = new Card("es", NULL, "A1", "nom", "2", "Actor", array("Película", "Cine", "Interpretar", "Jugar", "Teatro", "Protagonista"), array("Profession", "Art"));
$test->store();
$test2 = new Card(9);
echo "{$test}<br />{$test2}";
?>
</body>
示例4: Card
$tmpObj = new Card("it", NULL, "A2", "Nom", "1", "Art", array("Opera", "Scuola", "Colori", "Museo", "Dipingere"), array("Art"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "B1", "Nom", "1", "Traffico", array("Macchine", "Inquinamento", "Città", "Problema", "Rumore"), array("Ville"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "B1", "Nom", "1", "Volcano", array("Etna", "Vesuvio", "Uscire", "Fuoco", "Cenere"), array("Environnement", "Nature"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "B1", "Nom", "1", "Ingegnere", array("Edifici", "Costruire", "Lavoro", "Laurea", "Università"), array("Profession"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "A2", "Nom", "1", "Cinema", array("Art", "Film", "Vedere", "Telecamera", "Attore"), array("Divertissement", "Art"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "B1", "Nom", "1", "Stuzzicadente", array("Legno", "Dente", "Alimentation", "Johnny Stecchino", "Film"), array("Hygiène"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "B1", "Nom", "1", "Concerto", array("Musica", "Cantante", "Strumenti", "Ascoltare", "Teatro"), array("Divertissement"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "A2", "Nom", "1", "Arancio", array("Albero", "Fruita", "Arancione", "Clementine", "Pianta"), array("Alimentation"));
$tmpObj->store();
$nb++;
$tmpObj = new Card("it", NULL, "A2", "Nom", "1", "Anniversario", array("Ricorrenza", "Compleanno", "Matrimonio", "Auguri", "Celebrare"), array("Société"));
$tmpObj->store();
$nb++;
echo "<p><strong>{$nb}</strong> cards imported</p>";
?>
</body>
</html>
示例5: validate
private function validate()
{
if ($this->submit) {
//Categorie always "nom" TODO…
try {
$forbidden = array();
for ($i = 1; isset($this->res['tabou' . $i]); $i++) {
array_push($forbidden, $this->res['tabou' . $i]);
}
$carte = new Card($this->userlang, NULL, $this->res['nivcarte'], "nom", $this->createur, $this->res['mot'], $forbidden, array($this->res['theme_carte']), './views/card.inline.display.php');
$carte->store();
$_SESSION["LastStoredId"] = $carte->get_id();
$this->card = $carte;
$this->res = array('carteID' => $_SESSION["LastStoredId"]);
} catch (Exception $e) {
echo $e;
return false;
}
return true;
} else {
return false;
}
}