當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。