本文整理汇总了PHP中array_except函数的典型用法代码示例。如果您正苦于以下问题:PHP array_except函数的具体用法?PHP array_except怎么用?PHP array_except使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了array_except函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPaginate
public function checkPaginate($keepQuery = null)
{
$flag = true;
$request = Request::get($this->getPageName());
$cPage = $this->currentPage();
if ($this->isEmpty() && 1 != $cPage || 1 == $cPage && !is_null($request) && (int) $request != $cPage) {
if (is_null($keepQuery)) {
$keepQuery = $this->getKeepQuery();
}
if ($keepQuery) {
$query = array_except(Request::query(), $this->getPageName());
$this->appends($query);
}
$action = $this->getActionOnError();
switch ($action) {
case 'abort':
App::abort(404);
break;
case 'first':
$flag = Redirect::to($this->url(0), $this->getErrorStatus());
break;
case 'out':
$url = 1 == $this->currentPage() ? 0 : $this->lastPage();
$flag = Redirect::to($this->url($url), $this->getErrorStatus());
break;
default:
throw new PageNotFoundException();
}
}
return $flag;
}
示例2: extractCalendarClassNames
/**
* @param $classNames
* @return array
*/
private function extractCalendarClassNames($classNames)
{
if (is_string($classNames)) {
$classNames = explode(" ", $classNames);
}
return array_flip(array_except(array_flip($classNames), ['ui', 'calendar', 'event']));
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(Forum $forum, Request $request)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$forum->update($input);
return Redirect::route('Forum.show', $forum->id)->with('message', 'Forum updated.');
}
示例4: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(Request $request, $id)
{
$pay = Paygrade::findOrFail($id);
$input = array_except(Input::all(), '_method');
$pay->update($input);
return Redirect::route('admin.setup.job.paygrades.index')->withFlashSuccess('Pay grades data was successfully edited.');
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(Project $project, Task $task)
{
// return view('tasks/index',compact('project'));
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Task updated.');
}
示例6: makeAssets
/**
* Outputs <link> and <script> tags to load assets previously added with addJs and addCss method calls
* @param string $type Return an asset collection of a given type (css, rss, js) or null for all.
* @return string
*/
public function makeAssets($type = null)
{
if ($type != null) {
$type = strtolower($type);
}
$result = null;
$reserved = ['build'];
if ($type == null || $type == 'css') {
foreach ($this->assets['css'] as $asset) {
$attributes = HTML::attributes(array_merge(['rel' => 'stylesheet', 'href' => $this->getAssetEntryBuildPath($asset)], array_except($asset['attributes'], $reserved)));
$result .= '<link' . $attributes . '>' . PHP_EOL;
}
}
if ($type == null || $type == 'rss') {
foreach ($this->assets['rss'] as $asset) {
$attributes = HTML::attributes(array_merge(['rel' => 'alternate', 'href' => $this->getAssetEntryBuildPath($asset), 'title' => 'RSS', 'type' => 'application/rss+xml'], array_except($asset['attributes'], $reserved)));
$result .= '<link' . $attributes . '>' . PHP_EOL;
}
}
if ($type == null || $type == 'js') {
foreach ($this->assets['js'] as $asset) {
$attributes = HTML::attributes(array_merge(['src' => $this->getAssetEntryBuildPath($asset)], array_except($asset['attributes'], $reserved)));
$result .= '<script' . $attributes . '></script>' . PHP_EOL;
}
}
return $result;
}
示例7: update
/**
* Update the specified resource in storage.
*
* @param \App\Project $project
* @return Response
*/
public function update(User $user)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$user->update($input);
return Redirect::route('users.show', $user->name)->with('message', 'User updated.');
}
示例8: update
/**
* Update the specified resource in storage.
*
* @param License $license
* @return Response
*/
public function update(License $license, Request $request)
{
$input = array_except($request->all(), ['_method', '_token']);
$license->update($input);
Cache::flush();
return redirect()->route('licenses.show', $license->id)->with('message', 'License updated.')->with('message-class', 'success');
}
示例9: open
public function open(array $options = [])
{
$method = array_get($options, 'method', 'post');
if ($this->formConfig == []) {
$this->loadConfig();
}
$this->opened = true;
$options = $this->appendClassToOptions($this->formConfig['class'], $options);
// We need to extract the proper method from the attributes. If the method is
// something other than GET or POST we'll use POST since we will spoof the
// actual method since forms don't support the reserved methods in HTML.
$attributes['method'] = $this->getMethod($method);
$attributes['action'] = $this->getAction($options);
$attributes['accept-charset'] = 'UTF-8';
// If the method is PUT, PATCH or DELETE we will need to add a spoofer hidden
// field that will instruct the Symfony request to pretend the method is a
// different method than it actually is, for convenience from the forms.
$append = $this->getAppendage($method);
if (isset($options['files']) && $options['files']) {
$options['enctype'] = 'multipart/form-data';
}
// Finally we're ready to create the final form HTML field. We will attribute
// format the array of attributes. We will also add on the appendage which
// is used to spoof requests for this PUT, PATCH, etc. methods on forms.
$attributes = array_merge($attributes, array_except($options, $this->reserved));
// Finally, we will concatenate all of the attributes into a single string so
// we can build out the final form open statement. We'll also append on an
// extra value for the hidden _method field if it's needed for the form.
$attributes = $this->html->attributes($attributes);
return '<form' . $attributes . '>' . $append;
}
示例10: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param Project $project
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Project $project)
{
$input = array_except(Input::all(), '_method');
$project->update($input);
Session::flash('flash_message', 'Project updated successfully!');
return Redirect::route('projects.index')->with('message', 'Project created');
}
示例11: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(Request $request, $id)
{
$comp = CompanyStructure::findOrFail($id);
$input = array_except(Input::all(), '_method');
$comp->update($input);
return Redirect::route('admin.setup.company.structures.index')->withFlashSuccess('Company structure data was successfully edited.');
}
示例12: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return Response
*/
public function update(Project $project, Request $request)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$project->update($input);
return Redirect::route('project.index', $project->slug)->with('message', 'Project updated.');
}
示例13: getAuthorization
/**
* Serve authorization page
* @param Authorizer $authorizer
* @return View response
*/
public function getAuthorization(Authorizer $authorizer)
{
$authParams = $authorizer->getAuthCodeRequestParams();
$formParams = array_except($authParams, 'client');
$formParams['client_id'] = $authParams['client']->getId();
return view('auth.pages.authorization', ['params' => $formParams, 'client' => $authParams['client']]);
}
示例14: update
/**
* Update the specified resource in storage.
*
* @param \App\Project $project
* @param \App\Task $task
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function update(Project $project, Task $task, Request $request)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$task->update($input);
return Redirect::route('projects.tasks.show', [$project->slug, $task->slug])->with('message', 'Task updated.');
}
示例15: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Repair $repair, Request $request)
{
$input = array_except(Input::all(), ['_method']);
$this->validate($request, ['LicencePlate' => ['required', 'exists:cars', 'regex:/\\b([A-Z]{3}\\s?(\\d{3}|\\d{2}|d{1})\\s?[A-Z])|([A-Z]\\s?(\\d{3}|\\d{2}|\\d{1})\\s?[A-Z]{3})|(([A-HK-PRSVWY][A-HJ-PR-Y])\\s?([0][2-9]|[1-9][0-9])\\s?[A-HJ-PR-Z]{3})\\b/'], 'StaffId' => 'required|exists:staff,Id', 'Ongoing' => 'boolean', 'Type' => 'required', 'StartDate' => 'required|date', 'EndDate' => 'required|date|after:StartDate', 'Cost' => 'required|numeric|min:0', 'Paid' => 'boolean']);
$repair->update($input);
return Redirect::route('repairs.index')->with('message', 'Repair updated');
}