本文整理汇总了PHP中Errors::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP Errors::isEmpty方法的具体用法?PHP Errors::isEmpty怎么用?PHP Errors::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Errors
的用法示例。
在下文中一共展示了Errors::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _validate
/**
* Validates the model.
*
* @return boolean True if passed validators otherwise false
*/
private function _validate()
{
require_once 'Validations.php';
$validator = new Validations($this);
$validationOn = 'ValidationOn' . ($this->isNewRecord() ? 'Create' : 'Update');
foreach (array('beforeValidation', "before{$validationOn}") as $callback) {
if (!$this->invokeCallback($callback, false)) {
return false;
}
}
// need to store reference b4 validating so that custom validators have access to add errors
$this->errors = $validator->getRecord();
$validator->validate();
foreach (array('afterValidation', "after{$validationOn}") as $callback) {
$this->invokeCallback($callback, false);
}
if (!$this->errors->isEmpty()) {
return false;
}
return true;
}
示例2: Errors
break;
case "inscription":
$controle = new Errors();
if (empty($_POST['codeClientSignIn'])) {
$controle->add('Veuillez saisir votre code client', 'codeClientSignIn');
}
if (empty($_POST['emailSignIn'])) {
$controle->add('Veuillez saisir votre adresse email', 'emailSignIn');
}
if (empty($_POST['emailSignIn2'])) {
$controle->add('Veuillez confirmez votre adresse email', 'emailSignIn2');
}
if ($_POST['emailSignIn'] != $_POST['emailSignIn2']) {
$controle->add('Les adresses email ne sont pas identiques', 'emailNotSame');
}
if ($controle->isEmpty()) {
$codeClientSignIn = $_POST['codeClientSignIn'];
$emailSignIn = $_POST['emailSignIn'];
$customer = UtilisateursManager::getUtilisateurByCodeClientAndEmail($codeClientSignIn, $emailSignIn);
if ($customer) {
# fonction d'envoie de mot de passe par mail.
$password = Utils::random();
$customer->setMotDePasse(sha1($password));
UtilisateursManager::updateUtilisateurs($customer);
$mail = Mail::inscription($customer, $password);
if ($mail) {
Utils::json(array('result' => 'success', 'email' => $emailSignIn));
} else {
tils::json(array('result' => 'errorSendMail'));
}
} else {
示例3: Errors
break;
}
}
}
}
// section backoffice
if (isset($_POST['submit-backoffice'])) {
if (isset($_POST)) {
$error = new Errors();
if (empty($_POST['PATH_CLASS'])) {
$error->add('Veuilliez sassir le nom de la base de donnés. ', 'DBNAME');
}
if (empty($_POST['PATH'])) {
$error->add('Veuilliez sassir le chemi des fichers ', 'PATH');
}
if ($error->isEmpty()) {
$dir = $_POST['PATH_CLASS'];
$files = scandir($dir);
$menu = array();
foreach ($files as $file) {
if (count(explode('.php', $file)) > 1) {
$name = explode('.php', $file);
array_push($menu, $name[0]);
$content = file_get_contents($dir . $file);
explode($content);
// creation controller ;
}
}
}
}
}