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


PHP Companies::getMessages方法代碼示例

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


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

示例1: createAction

 /**
  * Creates a new companie
  */
 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => "companies", "action" => "index"));
     }
     $companie = new Companies();
     $companie->id = $this->request->getPost("id");
     $companie->name = $this->request->getPost("name");
     if (!$companie->save()) {
         foreach ($companie->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "companies", "action" => "new"));
     }
     $this->flash->success("companie was created successfully");
     return $this->dispatcher->forward(array("controller" => "companies", "action" => "index"));
 }
開發者ID:nhannv56,項目名稱:sample2_Phalcon_INVO,代碼行數:20,代碼來源:CompaniesController.php

示例2: createAction

 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->forward("companies/index");
     }
     $companies = new Companies();
     $companies->name = $this->request->getPost("name", "striptags");
     $companies->telephone = $this->request->getPost("telephone", "striptags");
     $companies->address = $this->request->getPost("address", "striptags");
     $companies->city = $this->request->getPost("city", "striptags");
     if (!$companies->save()) {
         foreach ($companies->getMessages() as $message) {
             $this->flash->error((string) $message);
         }
         return $this->forward("companies/new");
     }
     $this->flash->success("Company was created successfully");
     return $this->forward("companies/index");
 }
開發者ID:Rho1and0,項目名稱:invo,代碼行數:19,代碼來源:CompaniesController.php

示例3: createAction

 public function createAction()
 {
     if (!$this->request->isPost()) {
         return $this->_forward("companies/index");
     }
     $companies = new Companies();
     $companies->id = $this->request->getPost("id", "int");
     $companies->name = $this->request->getPost("name");
     $companies->telephone = $this->request->getPost("telephone");
     $companies->address = $this->request->getPost("address");
     $companies->city = $this->request->getPost("city");
     $companies->name = strip_tags($companies->name);
     $companies->telephone = strip_tags($companies->telephone);
     $companies->address = strip_tags($companies->address);
     $companies->city = strip_tags($companies->city);
     if (!$companies->save()) {
         foreach ($companies->getMessages() as $message) {
             Flash::error((string) $message, "alert alert-error");
         }
         return $this->_forward("companies/new");
     } else {
         Flash::success("companies was created successfully", "alert alert-success");
         return $this->_forward("companies/index");
     }
 }
開發者ID:racklin,項目名稱:invo,代碼行數:25,代碼來源:CompaniesController.php


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