本文整理汇总了PHP中Note::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::fetchAll方法的具体用法?PHP Note::fetchAll怎么用?PHP Note::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::fetchAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
session_start();
require 'vendor/autoload.php';
//importation des fonctions de
require "class/fredi.php";
//importation des modèles
require "models/User.php";
require "models/Note.php";
require "models/Fee.php";
//instanciation de slim
$app = new \Slim\Slim();
$app->config(array('templates.path' => './views'));
$app->get('/login', function () use($app) {
echo "connard";
// $app->render('login.php');
});
$app->get('/', function () use($app) {
$note = new Note();
$notes = $note->fetchAll(2);
$app->render('user/main.php', array('notes' => $notes));
});
$app->get('/hello/', function () {
echo "Hello, world!";
});
$app->render('header.php');
$app->run();
$app->render('footer.php');
示例2: Note
break;
}
} else {
$note = new Note();
$note = $note->fetch($id);
$app->render('note/single.php', array('note' => $note));
}
});
$app->post('/note/:id(/:action)', function ($id, $action = null) use($app) {
if (isset($action)) {
switch ($action) {
case 'add_fee':
$post = $app->request->post();
$fee = new Fee($post);
$fee->id_note = $id;
if (!$fee->save()) {
$err = "No";
}
$app->redirect('/note/' . $fee->id_note);
break;
default:
# code...
break;
}
}
});
$app->get('/notes', function () use($app) {
$note = new Note();
$notes = $note->fetchAll($_SESSION['userinfo']->id_user);
$app->render('note/list.php', array('notes' => $notes, 'user' => $_SESSION['userinfo']));
});