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


PHP Link::find方法代码示例

本文整理汇总了PHP中Link::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::find方法的具体用法?PHP Link::find怎么用?PHP Link::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Link的用法示例。


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

示例1: countLinks

 function countLinks($categoryName)
 {
     App::import('Model', 'Link');
     $link = new Link();
     $settings = array('conditions' => array('LinkCategory.name' => $categoryName));
     return $link->find('count', $settings);
 }
开发者ID:hardsshah,项目名称:bookmarks,代码行数:7,代码来源:link_category.php

示例2: post_edit

 public function post_edit()
 {
     $link = Link::find(Input::get('id'));
     $link->name = Input::get('name');
     $product->short_description = Input::get('short_description');
     $product->slug = Str::slug(Input::get('name'), '_');
     $product->save();
     return Redirect::to_action('admin.products@view', array($product->id))->with('flash', true)->with('flash_type', 'success')->with('flash_msg', 'Product updated successfully.');
 }
开发者ID:robmeijer,项目名称:seer,代码行数:9,代码来源:links.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $this->link = Link::find($id);
     $this->link->fill(Input::all());
     if (!$this->link->valid()) {
         return Redirect::back()->withInput()->with('errors', $this->link->errors);
     } else {
         $this->link->update();
         return Redirect::route('projects.index');
     }
 }
开发者ID:jcstrandburg,项目名称:portfoliowriter,代码行数:17,代码来源:LinkController.php

示例4: link_update

 /**
  * [link_update description]
  * @param  [type] $slug [description]
  * @return [type]       [description]
  */
 public function link_update($slug)
 {
     if (IS_POST) {
         $data = ['name' => I('post.name'), 'url' => I('post.url'), 'is_look' => I('post.is_look')];
         Link::where('id', '=', $slug)->update($data);
         View::success('修改成功');
         die;
     }
     $link = Link::find($slug)->toArray();
     $this->smarty->assign('link', $link);
     $this->smarty->assign('title', '修改友情链接_ISisWeb中文网后台管理_ISirPHPFramework');
     $this->smarty->display('Admin/System/update_link.html');
     // $this->view = View::make('/Admin/System/update_link')
     // 				->with('link',$link)
     // 				->with('title','修改友情链接_ISirPHP Framework');
 }
开发者ID:joymi,项目名称:ISirPHPFramework,代码行数:21,代码来源:SystemController.php

示例5: postDelete

 /**
  * Delete Link
  *
  * @return Response
  */
 public function postDelete()
 {
     if (!\Auth::check()) {
         return \Response::json(array('error' => array('code' => 'NOT-AUTH', 'http_code' => '403', 'message' => 'Forbidden')), 403);
     }
     if (!\Input::has("linkid")) {
         return \Response::json(array('error' => array('code' => 'MISSING-PARAMETERS', 'http_code' => '400', 'message' => 'Bad Request')), 400);
     }
     $linkID = \Input::get("linkid");
     $shortenedLink = \Link::find($linkID);
     if (\Auth::user()->id != $shortenedLink->user_id) {
         return \Response::json(array('error' => array('code' => 'NOT-AUTH', 'http_code' => '403', 'message' => 'Forbidden')), 403);
     }
     $shortenedLink->delete();
     if (\Auth::user()->quota_used - 1 >= 0) {
         \Auth::user()->quota_used -= 1;
         \Auth::user()->save();
     }
     return \Response::json(array('ok' => array('code' => 'LINK-DELETED', 'http_code' => '200', 'message' => 'OK')), 200);
 }
开发者ID:danielmcassey,项目名称:gekko,代码行数:25,代码来源:LinkController.php

示例6: getCategoryLink

 public function getCategoryLink($id)
 {
     $link = Link::find($id);
     if (isset($link->gov_id)) {
         $this->breadcrumbs->push('หมวดหมู่', URL::to('/categories'));
         $this->breadcrumbs->push($link->MiddleCategories->name, URL::to('/category/' . $link->MiddleCategories->id . '/new'));
         $this->breadcrumbs->push($link->name, URL::to('/category/link/' . $link->Gov->id . '/show'));
         $this->breadcrumbs->generate();
         return View::make('home.category_link')->with('link', $link);
     } else {
         App::abort(404);
     }
 }
开发者ID:pchaow,项目名称:pportal,代码行数:13,代码来源:HomeController.php

示例7: updateLink

 public function updateLink()
 {
     $id = Input::get('id');
     $fieldname = Input::get('field');
     $value = Input::get('value');
     $link = Link::find($id);
     $link->{$fieldname} = $value;
     $link->save();
     return $this->success(null, null);
 }
开发者ID:jcstrandburg,项目名称:portfoliowriter,代码行数:10,代码来源:ApiController.php

示例8: deleteLink

 public function deleteLink()
 {
     $link_id = Input::get('link_id');
     $link = Link::find($link_id);
     if (!$link->delete()) {
         return Response::json(array('errCode' => '1', 'message' => '删除失败!'));
     }
     return Response::json(array('errCode' => 0, 'message' => '删除成功!'));
 }
开发者ID:Jv-Juven,项目名称:opera-1,代码行数:9,代码来源:AdminHomeController.php

示例9: getShowLink

 public function getShowLink($id)
 {
     $link = Link::find($id);
     if (isset($link->gov_id)) {
         $gov = Gov::findOrFail($link->gov_id);
         $gov = $gov->name;
     } else {
         $gov = "ไม่ได้กำหนดหน่วยงาน";
     }
     $columns = Schema::getColumnListing('links');
     return View::make('admin.show_link')->with('link', $link)->with('columns', $columns)->with('govName', $gov);
 }
开发者ID:pchaow,项目名称:pportal,代码行数:12,代码来源:AdminController.php


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