本文整理汇总了PHP中Registry::addMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::addMessage方法的具体用法?PHP Registry::addMessage怎么用?PHP Registry::addMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::addMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$url = Registry::getUrl();
$id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
$user = new User($id);
if ($user->id) {
if ($user->delete()) {
Registry::addMessage("Usuario eliminado satisfactoriamente", "success");
}
}
Url::redirect(Url::site("users"));
}
示例2: delete
public function delete()
{
$url = Registry::getUrl();
$id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
$tipo = new Tipo($id);
if ($tipo->id) {
if ($tipo->delete()) {
Registry::addMessage("Tipo de entrada eliminado satisfactoriamente", "success");
}
}
Url::redirect(Url::site("tipos"));
}
示例3: delete
public function delete()
{
$url = Registry::getUrl();
$id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
$mosca = new Mosca($id);
if ($mosca->id) {
if ($mosca->delete()) {
Registry::addMessage("Mosca eliminada satisfactoriamente", "success");
//Log
Log::add(LOG_DELETE_MOSCA, $mosca);
}
}
Url::redirect(Url::site("moscas"));
}
示例4: doLogin
/**
* Login action
*/
public function doLogin()
{
$user = User::login($_REQUEST['login'], $_REQUEST['password']);
//Try to login
if ($user->id) {
//Add success message
Registry::addMessage("", "", "", Url::site());
} else {
//Add error message and redirect to login form view
Registry::addMessage("Datos incorrectos", "error", "login");
}
//Show ajax JSON response
$this->ajax();
}
示例5: validate
/**
* Insert and Update validation
* In this case, its the same for both methods
*
* @return bool
*/
private function validate()
{
//Check nombre
if (!$this->nombre) {
Registry::addMessage("Debes introducir un nombre", "error", "nombre");
} elseif (Self::getBy("nombre", $this->nombre, $this->id)) {
Registry::addMessage("Ya existe otro tipo de entrada con este nombre", "error", "nombre");
}
//Check codigo
if (!$this->codigo) {
Registry::addMessage("Debes introducir un codigo", "error", "codigo");
} elseif (Self::getBy("codigo", $this->codigo, $this->id)) {
Registry::addMessage("Ya existe otro tipo de entrada con este codigo", "error", "codigo");
}
//Return messages avoiding deletion
return Registry::getMessages(true);
}
示例6: export
public function export()
{
$date = date("Y-m-d", strtotime($_REQUEST["fecha"]));
//Force order
Evento::actualizarFechas($date);
$eventos = Evento::select(array("fecha" => $date));
$output = "";
if (count($eventos)) {
foreach ($eventos as $i => $evento) {
$output .= $evento->telson($i == 0) . "\n";
}
$filename = date("Ymd", strtotime($evento->getFecha())) . "Tribo.txt";
header('Content-Type: text/plain');
header("Content-Disposition: attachment; filename=" . $filename);
echo clearDiacritics($output);
//Log
Log::add(LOG_EXPORT_PARRILLA, $_REQUEST);
exit;
} else {
Registry::addMessage("Esta parrilla no tiene eventos", "error");
Url::redirect(Url::site("parrilla"));
}
}
示例7: validate
/**
* Insert and Update validation
* In this case, its the same for both methods
*
* @return bool
*/
private function validate()
{
//Check username
if (!$this->username) {
Registry::addMessage("Debes introducir tu nombre de usuario", "error", "username");
} elseif (User::getBy("username", $this->username, $this->id)) {
Registry::addMessage("Este nombre de usuario ya esta registrado", "error", "username");
}
//Check email
if (!$this->email) {
Registry::addMessage("Debes introducir tu email", "error", "email");
} elseif (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
Registry::addMessage("Email incorrecto", "error", "email");
} elseif (User::getBy("email", $this->email, $this->id)) {
Registry::addMessage("Este email ya esta registrado", "error", "email");
}
//Return messages avoiding deletion
return Registry::getMessages(true);
}
示例8: validateHouseNumber
public static function validateHouseNumber($houseNumber, $tipoId, $ignoreId = null)
{
$tipo = new Tipo($tipoId);
if (!$tipo->id) {
Registry::addMessage("Debes seleccionar un tipo primero", "warning", "houseNumber");
} else {
// Siempre 14 Caracteres
if (strlen($houseNumber) != 14) {
Registry::addMessage("La numeración debe tener 14 caracteres", "error", "houseNumber");
} else {
/// No puede haber 2 iguales
if (Self::getBy("houseNumber", $houseNumber, $ignoreId)) {
Registry::addMessage("Ya existe otra entrada con esta numeración", "error", "houseNumber");
} else {
// Máscara
if (!$tipo->checkMascara($houseNumber)) {
Registry::addMessage("La numeración no coincide con su tipo: " . $tipo->mascara, "error", "houseNumber");
}
}
}
}
//Return messages avoiding deletion
return !Registry::getMessages(true);
}
示例9: delete
public function delete()
{
$url = Registry::getUrl();
$id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
$entrada = new Entrada($id);
if ($entrada->id) {
if ($entrada->delete()) {
Registry::addMessage("Entrada eliminada satisfactoriamente", "success");
//Log
Log::add(LOG_DELETE_ENTRADA, $entrada);
}
}
Url::redirect(Url::site("entradas"));
}