本文整理汇总了PHP中manager::read_note方法的典型用法代码示例。如果您正苦于以下问题:PHP manager::read_note方法的具体用法?PHP manager::read_note怎么用?PHP manager::read_note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manager
的用法示例。
在下文中一共展示了manager::read_note方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Copyright
<?php
/*
/ WebNote - see readme.md for details
/ Copyright (C) 2012 David Glenck - <dev@ihdg.ch>
/ Published under GNU GPLv3
/ - see licences/gpl-3.0.txt or <http://www.gnu.org/licenses/>
*/
/*//Debug
error_reporting(E_ALL);
ini_set('display_errors', '1');
//*/
// includes
require 'manager.php';
require 'dep/php/markdown.php';
// The Initializer:
// loads notes and saves them into an array
$load = new manager('admin');
// only one user (for now)
$load->read_note();
// load all notes
$WN_notes = $load->get();
// get loaded notes
示例2: elseif
if (!$manager->write_note($note)) {
echo '{"error": 200, "message": "Could not write the note."}';
die;
}
echo '{"id": ', $arg_id, '}';
//## Read a note ##//
} elseif ("read" == $arg_action) {
// return error if 'id' is not set
if (!isset($_POST['id']) || $_POST['id'] == '') {
echo '{"error": 301, "message": "\'id\' must be set for action (read)."}';
die;
} else {
$arg_id = $_POST['id'];
}
// read note
$manager->read_note($arg_id);
$note = $manager->get($arg_id);
// return note (or error).
if (empty($note)) {
echo '{"error": 302, "message": "Note with id (', $arg_id, ') could not be found."}';
die;
} else {
echo json_encode($note);
}
//## Delete a note ##//
} elseif ("delete" == $arg_action) {
// return error if 'id' is not set
if (!isset($_POST['id']) || $_POST['id'] == '') {
echo '{"error": 401, "message": "\'id\' must be set for action (read)."}';
die;
} else {