• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP trans_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: destroy

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


示例17: destroy

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


示例18: destroy

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


示例19: destroy

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


示例20: destroy

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP transaction_cycle函数代码示例发布时间:2022-05-23
下一篇:
PHP trans_choice函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap