本文整理汇总了PHP中Messages::getMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::getMessages方法的具体用法?PHP Messages::getMessages怎么用?PHP Messages::getMessages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::getMessages方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
$this->initalize();
$msg = new Messages();
$success = $msg->save($this->request->getPost(), array('title', 'text'));
if (!$success) {
$this->_msgs['error'] = array();
foreach ($msg->getMessages() as $msgs) {
$this->_msgs['error'] = $msgs;
}
$this->flash->error($this->_msgs['error']);
} else {
$this->flash->success('success adding message');
$this->_msgs['success'] = "Success adding Message";
}
$this->view->form = new MessageForm();
$this->view->form->initalize();
if ($this->request->isPost()) {
$this->view->form->clear();
$this->dispatcher->forward(array("controller" => "message", "action" => "list"));
}
}
示例2: array
<?php
// Business Delegate
// load all scripts into memory
require_once 'Parameters.php';
require_once 'NewUserAction.php';
//require_once('init.php');
//loadScripts();
$data = array("status" => "not set!");
if (Utils::isPOST()) {
if (Utils::isAJAX()) {
$parameters = new Parameters("POST");
$userNewAction = new NewUserAction();
$userNewAction->setParameters($parameters);
$response = $userNewAction->register();
if ($response) {
$data = array("status" => "success", "user" => $response, "msgs" => Messages::getMessages());
} else {
// error message
$data = array("status" => "error", "msg" => Messages::getMessages());
}
} else {
$data = array("status" => "error", "msg" => "AJAX Required.");
}
} else {
$data = array("status" => "error", "msg" => "Only POST allowed.");
}
// lastly send JSON response
echo json_encode($data, JSON_FORCE_OBJECT);
// for objects do this:
// json_encode(get_object_vars($your_object));
示例3: array
$profile = $showUserProfileAction->getProfile();
// here's where we can choose how to render: AJAX or non-AJAX
// this might affect how we output the data (i.e., JSON vs HTML)
if (Utils::isAJAX()) {
$data = array();
// AJAX means that we'll send it as JSON - at least for this call
if ($profile == null) {
// didn't find a profile with that name
$data = array("status" => "error", "msg" => Messages::getMessages());
} else {
$data = array("status" => "success", "profile" => $profile);
}
echo json_encode($data, JSON_FORCE_OBJECT);
return;
} else {
// render the whole page using PHPTAL
// finally, create a new template object
$template = new PHPTAL('index.xhtml');
// now add the variables for processing and that you created from above:
$template->page_title = "Index With Design Patterns";
$template->profile = $profile;
// messages last
$template->messages = Messages::getMessages();
// execute the template
try {
echo $template->execute();
} catch (Exception $e) {
// not much else we can do here if the template engine barfs
echo $e;
}
}
示例4: getConnection
<?php
require_once 'connection.php';
require_once 'models/chat-model.php';
$conn = getConnection();
$model = new Messages();
$messages = $model->getMessages();
var_dump($messages);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chattin'</title>
</head>
<body>
<form action="" method="GET">
<input type="textarea"></input>
<input type="submit"></input>
</form>
</body>
</html>
示例5: header
require_once $controller;
$content_var = $smarty->get_template_vars('CONTENT');
if (empty($content_var)) {
$content_var = $page . '.tpl';
}
} else {
if (file_exists($template)) {
$content_var = $page . '.tpl';
} else {
header("HTTP/1.1 404 Not Found");
$smarty->assign('ERROR', 'The page you are trying to access does not exists.');
$smarty->assign('ERROR_TITLE', 'Page not found');
$content_var = 'components/error.tpl';
}
}
$smarty->assign('CONTENT', $content_var);
#index:
$index = $smarty->get_template_vars('INDEX');
if (empty($index)) {
if (empty($_GET['index'])) {
$index = 'components/index.tpl';
} else {
$index = 'components/' . $_GET['index'] . '.tpl';
}
}
#solve CSS cache problem:
$smarty->assign('CSS_TIMESTAMP', filemtime($config->absolute_path . '/admin/css/index.css'));
$smarty->assign('config', $config);
$smarty->assign('page', $page);
$smarty->assign('messages', Messages::getMessages());
$smarty->display($index);
示例6: Messages
$result = $msg->setMsgState('unerase', $data['id']);
if ($result->resultado) {
echo 'ok';
}
}
break;
case "set_erase_send":
$msg = new Messages($db);
$filtros = array();
$filtros['id_message_user'] = $data['id'];
if ($_SESSION['user']['type'] == PATIENT) {
$user_id = $_SESSION['user']['id'];
} else {
$user_id = 1;
}
$result = $msg->getMessages($_SESSION['user']['type'], $user_id, $filtros);
if ($result->resultado) {
$result = $msg->setMsgState('erase_send', $data['id']);
if ($result->resultado) {
echo 'ok';
}
}
break;
case "get_admins":
$admin = new Admin($db);
$result = $admin->getAdminsList();
if ($result->resultado) {
$encode = array();
for ($i = 0; $i < count($result->datos); $i++) {
$encode[] = $result->datos[$i];
}
示例7: getMessages
function getMessages()
{
$messages = new Messages();
echo $messages->getMessages();
}
示例8: Messages
<?php
include_once "../includes/webservice.inc.php";
$webService = new Webservices_Writer();
$webService->init();
$messageObj = new Messages();
$data = isset($_POST['data']) ? $_POST['data'] : '';
$result = $messageObj->getMessages($data);
if ($result) {
$webService->createXMLInstance();
$webService->appendArrayToRootNode('', $result);
$webService->displayXML();
} else {
$xmls = $webService->errorXML(join(",", $messageObj->errorMessages));
$webService->outputXML($xmls);
}
示例9: array
// Business Delegate
// load all scripts into memory
//require_once('init.php');
require_once 'Parameters.php';
require_once 'ShowUserProfileAction.php';
require_once 'Utils.php';
//loadScripts();
$data = array("status" => "not set!");
if (Utils::isPOST()) {
if (Utils::isAJAX()) {
$parameters = new Parameters("POST");
$userProfileAction = new ShowUserProfileAction();
$userProfileAction->setParameters($parameters);
$response = $userProfileAction->getProfile();
if ($response) {
$data = array("status" => "success", "user" => $response, "msgs" => Messages::getMessages());
} else {
// error message
$data = array("12status" => "error", "msg" => Messages::getMessages());
}
} else {
$data = array("13status" => "error", "msg" => "AJAX Required.", "msg" => Messages::getMessages());
}
} else {
$data = array("status" => "error", "msg" => "Only POST allowed.", "msg" => Messages::getMessages());
}
// lastly send JSON response
echo json_encode($data, JSON_FORCE_OBJECT);
// for objects do this:
// json_encode(get_object_vars($your_object));
示例10: indexAction
/** Display list of messages sent
* @access public
* @return void
*/
public function indexAction()
{
$this->view->params = $this->getAllParams();
$this->view->messages = $this->_messages->getMessages($this->getAllParams());
}
示例11:
<!DOCTYPE html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en" xml:lang="en"><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en" xml:lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" xml:lang="en"><![endif]--><!--[if gt IE 8]><!-->
<html class="no-js" lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<!--<![endif]-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Old Boys Soccer League</title>
<link rel="stylesheet" href="css/uikit.min.css" />
<script src="jquery-2.1.4.min.js"></script>
<script src="js/uikit.min.js"> </script>
<link type='text/css' title='standard' rel='stylesheet' href='style_messaging.css' />
<link type='text/css' title='standard' rel='stylesheet' href='media.css' />
</head>
<body class="en" >
<div class="container">
<div class="navbar navbar-sectionheader">
<div class="header-top">
<img class="header-image" src="../oldboys_pictures/OldboysLogoPNG.png" />
</div>
<div class="menu-wrap">
<!-- This is the container enabling the JavaScript -->
<div class="uk-button-dropdown" data-uk-dropdown>
<!-- This is the button toggling the dropdown -->