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