本文整理汇总了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');
}
}