本文整理匯總了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'));
}
}
示例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');
}
}