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


PHP trans_url函数代码示例

本文整理汇总了PHP中trans_url函数的典型用法代码示例。如果您正苦于以下问题:PHP trans_url函数的具体用法?PHP trans_url怎么用?PHP trans_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: sendMail

 /**
  * Send mail
  *
  * @param string $slug
  *
  * @return response
  */
 public function sendMail(Request $request)
 {
     $data = $request->all();
     Mail::send('contact::public.emails.message', $data, function ($message) use($data) {
         $message->from($data['email'], $data['name']);
         $message->to(config('package.contact.to'));
     });
     Session::flash('success', 'Success! Your message send successfully.');
     return redirect(trans_url('/contacts'));
 }
开发者ID:litecms,项目名称:contact,代码行数:17,代码来源:ContactController.php

示例2: getPictureAttribute

 /**
  * Returns the profile picture of the user.
  *
  * @return string image path
  */
 public function getPictureAttribute($value)
 {
     if (!empty($value)) {
         $photo = json_encode($value);
         return trans_url($photo['folder'] . '/' . $photo['file']);
     }
     if ($this->sex == 'female') {
         return trans_url('img/avatar/female.png');
     }
     return trans_url('img/avatar/male.png');
 }
开发者ID:LavaLite,项目名称:framework,代码行数:16,代码来源:user.php

示例3: upload

 /**
  * Show resume's list.
  *
  * @param string $slug
  *
  * @return response
  */
 protected function upload(Request $request)
 {
     try {
         $attributes = $request->all();
         $attributes['user_id'] = user_id();
         $resume = $this->repository->create($attributes);
         Session::flash('success', 'Success! Your Resume uploaded successfully.');
         return redirect(trans_url('careers/job'));
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
开发者ID:litecms,项目名称:career,代码行数:19,代码来源:ResumeController.php

示例4: destroy

 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(GalleryUserRequest $request, Gallery $gallery)
 {
     try {
         $t = $gallery->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('gallery::gallery.name')]), 'code' => 202, 'redirect' => trans_url('/user/gallery/gallery')], 202);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
开发者ID:litecms,项目名称:gallery,代码行数:16,代码来源:GalleryUserController.php

示例5: update

 /**
  * Update the specified resource.
  *
  * @param Request $request
  * @param int     $id
  *
  * @return Response
  */
 public function update(MenuRequest $request, $id)
 {
     try {
         $menu = $this->repository->update($request->all(), $id);
         $this->responseCode = 204;
         $this->responseMessage = trans('messages.success.updated', ['Module' => trans('menu::menu.name')]);
         $this->responseRedirect = trans_url('/admin/menu/submenu/' . $menu->getRouteKey());
         return $this->respond($request);
     } catch (Exception $e) {
         $this->responseCode = 400;
         $this->responseMessage = $e->getMessage();
         $this->responseRedirect = trans_url('/admin/menu/submenu/' . $menu->getRouteKey());
         return $this->respond($request);
     }
 }
开发者ID:litepie,项目名称:menu,代码行数:23,代码来源:SubMenuAdminController.php

示例6: destroy

 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(ResumeUserRequest $request, Resume $resume)
 {
     try {
         $this->repository->delete($resume->getRouteKey());
         return redirect(trans_url('/user/career/resume'))->with('message', trans('messages.success.deleted', ['Module' => trans('career::resume.name')]))->with('code', 204);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
开发者ID:litecms,项目名称:career,代码行数:16,代码来源:ResumeUserController.php

示例7: destroy

 /**
  * Remove the forum.
  *
  * @param Model   $forum
  *
  * @return Response
  */
 public function destroy(ForumAdminRequest $request, Forum $forum)
 {
     try {
         $t = $forum->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('forum::forum.name')]), 'code' => 202, 'redirect' => trans_url('/admin/forum/forum/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/forum/forum/' . $forum->getRouteKey())], 400);
     }
 }
开发者ID:litecms,项目名称:forum,代码行数:16,代码来源:ForumAdminController.php

示例8: destroy

 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(TeamUserRequest $request, Team $team)
 {
     try {
         $this->repository->delete($team->getRouteKey());
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('team::team.name')]), 'code' => 202, 'redirect' => trans_url('/user/team/team')], 202);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
开发者ID:litecms,项目名称:team,代码行数:16,代码来源:TeamUserController.php

示例9: bestAnswer

 /**
  * Update the specified resource.
  *
  * @param Request $request
  * @param Forum $forum
  *
  * @return Response
  */
 public function bestAnswer(Forum $forum)
 {
     try {
         $forums = $this->repository->scopeQuery(function ($query) use($forum) {
             return $query->whereParentId($forum->parent_id)->orderBy('id', 'DESC');
         })->all();
         foreach ($forums as $key => $value) {
             $value->update(['best_answer' => 0]);
         }
         $forum->update(['best_answer' => 1]);
         return redirect(trans_url('/user/forum/forum'))->with('message', trans('messages.success.created', ['Module' => trans('forum::forum.name')]))->with('code', 201);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
开发者ID:litecms,项目名称:forum,代码行数:23,代码来源:ForumUserController.php

示例10: update

 /**
  * Update the specified resource.
  *
  * @param Request $request
  * @param int     $id
  *
  * @return Response
  */
 public function update(AdminMenuWebRequest $request, $id)
 {
     try {
         $attributes = $request->all();
         $menu = $this->repository->update($attributes, $id);
         return response()->json(['message' => trans('messages.success.updated', ['Module' => trans('menu::menu.name')]), 'code' => 204, 'redirect' => trans_url('/admin/menu/submenu/' . $menu->getRouteKey())], 201);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/menu/submenu/' . $menu->getRouteKey())], 400);
     }
 }
开发者ID:LavaLite,项目名称:framework,代码行数:18,代码来源:SubMenuAdminWebController.php

示例11: destroy

 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(RoleAdminRequest $request, Role $role)
 {
     try {
         $t = $role->delete();
         $this->responseCode = 202;
         $this->responseMessage = trans('messages.success.deleted', ['Module' => 'Role']);
         $this->responseData = $role;
         $this->responseRedirect = trans_url('/admin/user/role/0');
         return $this->respond($request);
     } catch (Exception $e) {
         $this->responseCode = 400;
         $this->responseMessage = $e->getMessage();
         $this->responseRedirect = trans_url('/admin/user/role/' . $role->getRouteKey());
         return $this->respond($request);
     }
 }
开发者ID:litepie,项目名称:user,代码行数:23,代码来源:RoleAdminController.php

示例12: destroy

 /**
  * Remove the task.
  *
  * @param Model   $task
  *
  * @return Response
  */
 public function destroy(TaskAdminRequest $request, Task $task)
 {
     try {
         $t = $task->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('task::task.name')]), 'code' => 202, 'redirect' => trans_url('/admin/task/task')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/task/task/' . $task->getRouteKey())], 400);
     }
 }
开发者ID:lavalite,项目名称:task,代码行数:16,代码来源:TaskAdminController.php

示例13: destroy

 /**
  * Remove the testimonial.
  *
  * @param Model   $testimonial
  *
  * @return Response
  */
 public function destroy(TestimonialAdminRequest $request, Testimonial $testimonial)
 {
     try {
         $t = $testimonial->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('testimonial::testimonial.name')]), 'code' => 202, 'redirect' => trans_url('/admin/testimonial/testimonial/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/testimonial/testimonial/' . $testimonial->getRouteKey())], 400);
     }
 }
开发者ID:litecms,项目名称:testimonial,代码行数:16,代码来源:TestimonialAdminController.php

示例14: destroy

 /**
  * Remove the message.
  *
  * @param Model   $message
  *
  * @return Response
  */
 public function destroy(MessageAdminRequest $request, Message $message)
 {
     try {
         if (!empty($request->get('arrayIds'))) {
             $ids = $request->get('arrayIds');
             $t = $this->repository->deleteMultiple($ids);
             return $t;
         } else {
             $t = $message->delete();
         }
         $this->repository->pushCriteria(new \Lavalite\Message\Repositories\Criteria\MessageAdminCriteria());
         $inbox_count = $this->repository->msgCount('Inbox');
         $trash_count = $this->repository->msgCount('Trash');
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('message::message.name')]), 'code' => 202, 'redirect' => trans_url('/admin/message/message/0'), 'inbox_count' => $inbox_count, 'trash_count' => $trash_count], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/message/message/' . $message->getRouteKey())], 400);
     }
 }
开发者ID:lavalite,项目名称:message,代码行数:25,代码来源:MessageAdminController.php

示例15: destroy

 /**
  * Remove the pricelist.
  *
  * @param Model   $pricelist
  *
  * @return Response
  */
 public function destroy(PriceListAdminRequest $request, PriceList $pricelist)
 {
     try {
         $t = $pricelist->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('pricelist::pricelist.name')]), 'code' => 202, 'redirect' => trans_url('/admin/pricelist/pricelist/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/pricelist/pricelist/' . $pricelist->getRouteKey())], 400);
     }
 }
开发者ID:litecms,项目名称:pricelist,代码行数:16,代码来源:PriceListAdminController.php


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