當前位置: 首頁>>代碼示例>>PHP>>正文


PHP v::object方法代碼示例

本文整理匯總了PHP中v::object方法的典型用法代碼示例。如果您正苦於以下問題:PHP v::object方法的具體用法?PHP v::object怎麽用?PHP v::object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在v的用法示例。


在下文中一共展示了v::object方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postTransfer

 public function postTransfer()
 {
     try {
         if ($this->app->session->phrase != $this->app->request->post("captcha")) {
             throw new InvalidCustomException("Captcha yang anda masukan salah");
         }
         $member_from = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_from"));
         $member_to = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_to"));
         v::object()->assert($member_from);
         v::object()->assert($member_to);
         $transfer = new Transfer();
         $transfer->massAssignment($this->app->request->post());
         $transfer->setFromLogin($member_from);
         $transfer->setToLogin($member_to);
         $this->app->em->persist($transfer);
         $this->app->em->flush();
         $this->app->view()->appendData(["isSuccess" => true, "successTitle" => "Success", "successMessage" => "Transfer Request anda sudah kami terima"]);
     } catch (AbstractNestedException $e) {
         $errors = $e->findMessages(["numeric" => "{{name}} harus berisi numeric", "alnum" => "{{name}} harus berisi alphanumeric", "email" => "{{name}} harus berisi email yang valid", "float" => "{{name}} harus bernilai desimal", "notEmpty" => "Mohon diisi semua field", "equals" => "{{input}} tidak cocok dengan yang ada didatabase", "object" => "no login tidak dapat ditemukan didalam database", "startsWith" => "Nomor telepon harus berawalan dengan +", 'uploaded' => "file upload gagal"]);
         $this->validationMessage($errors);
     } catch (InvalidCustomException $e) {
         $this->validationMessage(["custom" => $e->getMessage()]);
     }
     $this->app->render('Pages/_transferBalance.twig');
 }
開發者ID:semplon,項目名稱:mabes,代碼行數:25,代碼來源:TransferController.php


注:本文中的v::object方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。