当前位置: 首页>>代码示例>>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;未经允许,请勿转载。