当前位置: 首页>>代码示例>>PHP>>正文


PHP client::create方法代码示例

本文整理汇总了PHP中client::create方法的典型用法代码示例。如果您正苦于以下问题:PHP client::create方法的具体用法?PHP client::create怎么用?PHP client::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在client的用法示例。


在下文中一共展示了client::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  * POST /clients
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $validation = Validator::make($input, Client::$rules);
     if ($validation->passes()) {
         $this->client->create($input);
         return Response::json(array('message' => 'done'));
     }
 }
开发者ID:sonoftheweb,项目名称:laravel-angularjs-boilerplate,代码行数:15,代码来源:ClientsController.php

示例2: doInsert

function doInsert()
{
    if (isset($_POST['submit'])) {
        $CLIENTNAME = $_POST['cname'];
        $CLIENTSHORTNAME = $_POST['csname'];
        $CLIENTADDRESS = $_POST['caddress'];
        $CLIENTTELEPHONE = $_POST['ctelephone'];
        $CLIENTEMAIL = $_POST['cemail'];
        $CLIENTWEBSITE = $_POST['cwebsite'];
        $CLIENTSECTOR = $_POST['csector'];
        $client = new client();
        $client->client_name = $CLIENTNAME;
        $client->client_short_name = $CLIENTSHORTNAME;
        $client->client_address = $CLIENTADDRESS;
        $client->client_telephone = $CLIENTTELEPHONE;
        $client->client_email = $CLIENTEMAIL;
        $client->client_website = $CLIENTWEBSITE;
        $client->client_sector = $CLIENTSECTOR;
    }
    if ($CLIENTNAME == "") {
        message('First name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTSHORTNAME == "") {
        message('Last Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTADDRESS == "") {
        message('Middle Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTTELEPHONE == "") {
        message('Gender Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTEMAIL == "") {
        message('Display name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTWEBSITE == "") {
        message('Qualification is required!', "error");
        redirect('index.php?view=add');
    } elseif ($CLIENTSECTOR == "") {
        message('Title is required!', "error");
        redirect('index.php?view=add');
    } else {
        $client->create();
        message('New client addedd successfully!', "success");
        redirect('index.php?view=list');
    }
}
开发者ID:allybitebo,项目名称:ucb,代码行数:46,代码来源:controller.php


注:本文中的client::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。