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


PHP Listing类代码示例

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


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

示例1: create

 /**
  * {@inheritdoc}
  */
 public function create(Listing $listing)
 {
     $page = $listing->page();
     $pages = $listing->pagesCount();
     $links = ['prev' => null, 'next' => null, 'current' => $listing->page(), 'pages' => []];
     if (!$pages) {
         return $links;
     }
     if ($page > 1) {
         $links['prev'] = $listing->getPageUrl($page - 1);
     }
     if ($page < $pages) {
         $links['next'] = $listing->getPageUrl($page + 1);
     }
     // first and last always
     $links['pages'][1] = $listing->getPageUrl(1);
     $from = max($page - $this->back - 1, 2);
     $to = min($page + $this->forward + 1, $pages - 1);
     for ($i = $from; $i <= $to; $i++) {
         if ($i != 2 && $i != $pages - 1 && ($i == $page - $this->back - 1 || $i == $page + $this->forward + 1)) {
             // placeholders
             $links['pages'][$i] = null;
         } else {
             $links['pages'][$i] = $listing->getPageUrl($i);
         }
     }
     $links['pages'][$pages] = $listing->getPageUrl($pages);
     return $links;
 }
开发者ID:minchal,项目名称:vero,代码行数:32,代码来源:SimplePager.php

示例2: parse

 /**
  * Parse input into nodes
  *
  * @param  net.daringfireball.markdown.Input $lines
  * @return net.daringfireball.markdown.Node
  */
 public function parse($lines)
 {
     $empty = false;
     $target = null;
     $result = new Listing($this->type);
     while ($lines->hasMoreLines()) {
         $line = $lines->nextLine();
         // An empty line makes the list use paragraphs, except if it's the last line.
         if (0 === $line->length()) {
             $empty = true;
             continue;
         }
         // Indented elements form additional paragpraphs inside list items. If
         // the line doesn't start with a list bullet, this means the list is at
         // its end.
         if (preg_match('/^(\\s+)?([+*-]+|[0-9]+\\.) /', $line, $m) && !preg_match('/^(\\* ?){3,}$/', $line)) {
             $empty && ($result->paragraphs = true);
             $empty = false;
             // Check whether we need to indent / dedent the list level, or whether
             // the list item belongs to this list
             $level = strlen($m[1]) / 2;
             if ($level > $this->level) {
                 $lines->resetLine($line);
                 $target = $target ?: $result->add(new ListItem($result))->add(new Paragraph());
                 $target->add($this->enter(new self($this->type, $level))->parse($lines));
             } else {
                 if ($level < $this->level) {
                     $lines->resetLine($line);
                     break;
                 } else {
                     $target = $result->add(new ListItem($result))->add(new Paragraph());
                     $line->forward(strlen($m[0]));
                     $this->tokenize($line, $target);
                 }
             }
         } else {
             if ('  ' === substr($line, 0, 2)) {
                 // Add paragraph to existing list item
                 $paragraph = $result->last()->add(new Paragraph());
                 $line->forward(2);
                 $this->tokenize($line, $paragraph);
             } else {
                 $lines->resetLine($line);
                 break;
             }
         }
     }
     return $result;
 }
开发者ID:xp-forge,项目名称:markdown,代码行数:55,代码来源:ListContext.class.php

示例3: action_delete

 public function action_delete($id)
 {
     if (Session::has('id')) {
         $account = Account::find(Session::get('id'));
         $location = Location::find($id);
         $owner = Account::find($location->account_id);
         if ($account->id == $owner->id) {
             $listings = Listing::where_location_id($location->id);
             // foreach($listings as $listing)
             // {
             // 	$images = Image::where_listing_id($listing->id);
             // 	foreach($images as $image)
             // 	{
             // 		$image->delete();
             // 	}
             // 	$listing->delete();
             // }
             $location->delete();
             return Redirect::to('/account/myLocations/');
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
开发者ID:angmark0309,项目名称:remarket,代码行数:26,代码来源:location.php

示例4: run

 public function run()
 {
     $box = Pages::getPageById(PAGE_PROPERTY_BOX);
     $model = new ProEnquiryProperty();
     $mListing = Listing::model()->findByPk($this->property_id);
     //        echo $mListing->property_name_or_address;die;
     Listing::ReplaceContentCmsPage($box, $mListing);
     $model->country_id = ActiveRecord::getDefaultAreaCode();
     if (isset(Yii::app()->user->id)) {
         $model->name = Yii::app()->user->title . ' ' . Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         if (Yii::app()->user->role_id != ROLE_REGISTER_MEMBER) {
             $model->email = Yii::app()->user->email_not_login;
         }
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
     }
     $this->dir = Yii::getPathOfAlias('application.components.views') . '/_agent_detail.php';
     $model->description = trim(strip_tags($box->content));
     if ($this->position == "bottom") {
         $this->render("enquiry_bottom", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'bottom'));
     } else {
         $this->render("enquiry_right", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'right'));
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:25,代码来源:EnquiryProperty.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  string $location
  * @return Response
  */
 public function show()
 {
     $location = Input::get('location');
     $type = strtolower(Input::get('type'));
     $wildcardLocation = "%" . $location . "%";
     if (Input::has('type')) {
         $types = array('meeting-room', 'coworking', 'desk');
         if (!in_array($type, $types, true)) {
             return Redirect::to('/')->with('flash_message_404', "Sorry, we don't have that type of space so we brought you back home!");
         }
         $listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
     } else {
         $listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
     }
     $colNum = Listing::where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->where('isPublic', '=', '1')->count();
     switch ($colNum) {
         case 1:
             $colNum = 12;
             break;
         case 2:
             $colNum = 6;
             break;
         case 3:
             $colNum = 3;
             break;
     }
     $title = ucwords("Search: " . $type . " spaces in " . $location);
     return View::make('search.results')->with('listings', $listings)->with('title', $title)->with('colNum', $colNum);
 }
开发者ID:s-matic,项目名称:collab-consumption,代码行数:35,代码来源:SearchController.php

示例6: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Listing::create([]);
     }
 }
开发者ID:remix101,项目名称:compex,代码行数:7,代码来源:ListingsTableSeeder.php

示例7: getListingCount

 public function getListingCount()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $this->id);
     $criteria->compare('status', STATUS_ACTIVE);
     $criteria->compare('status_listing', STATUS_LISTING_ACTIVE);
     return Listing::model()->count($criteria);
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:8,代码来源:ProAgent.php

示例8: down

 /**
  * Revert the changes to the database.
  *
  * @return void
  */
 public function down()
 {
     //
     $listings = Listing::all();
     foreach ($listings as $listing) {
         $listing->delete();
     }
 }
开发者ID:angmark0309,项目名称:remarket,代码行数:13,代码来源:2013_02_27_213554_insert_listings.php

示例9: sort_link

 function sort_link($link_order, $text, $order, $cur_page, $direction, $default_direction)
 {
     /*
      * 
      *<th><a class="sorting" href='<?= $base_url ?><?= $cur_page ?>/name/<?= Listing::reverse_direction($order == 'name' ? $direction : $default_direction) ?>'>Name</a></th>
      */
     return anchor($base_url . $cur_page . "/" . $order . "/" . Listing::reverse_direction($order == $link_order ? $direction : $default_direction), $text);
 }
开发者ID:ram-izaap,项目名称:got-safety,代码行数:8,代码来源:sort_helper.php

示例10: run

 public function run()
 {
     $listingInfo = Listing::model()->findByPk($this->listing_id);
     if ($listingInfo) {
         $this->listing_title = $listingInfo->property_name_or_address;
     }
     $model = $this->searchReleatedListing();
     $this->render("listing_releated_page_thank_you/index", array('model' => $model));
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:9,代码来源:ListingReleatedOnPageThankYouWidget.php

示例11: action_index

 public function action_index()
 {
     $users_files = Listing::get_list();
     $users_files = array_diff($users_files, array('.', '..'));
     if (isset($_SESSION['user'])) {
         include_once dir . '/view/list.php';
     } else {
         header('Location: /');
     }
     return true;
 }
开发者ID:Gr1n4,项目名称:file-sharing.ru,代码行数:11,代码来源:List_controller.php

示例12: actionSearch

 public function actionSearch($searchtext = '')
 {
     if ($searchtext == '') {
         $this->actionIndex(0);
         return;
     }
     $categories = array();
     $listings = Listing::model()->searchFrontendListings($searchtext);
     ViewsTrack::addCategoryView(0);
     $this->render('index', array('categories' => $categories, 'listings' => $listings));
 }
开发者ID:yasirgit,项目名称:hotmall,代码行数:11,代码来源:SiteController.php

示例13: actionCompanyListingMoveto

 /**
  * @Author: ANH DUNG Aug 05, 2014
  * @Todo: CompanyEditContact at grid
  * @Param: $id list id 1,2,3 ...
  */
 public function actionCompanyListingMoveto($id)
 {
     try {
         $id = $this->FormatListId($id);
         $company_listing_type = $_GET['company_listing_type'];
         Listing::ChangeTypeByListId($id, $company_listing_type);
     } catch (Exception $ex) {
         echo $exc->getMessage();
         die;
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:16,代码来源:AjaxController.php

示例14: up

 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     //
     $listings = Listing::all();
     foreach ($listings as $l) {
         for ($i = 0; $i < 5; $i++) {
             $image = new Image();
             $image->description = "PIC DESCRIPTIOIN";
             $image->listing_id = $l->id;
             $image->save();
         }
     }
 }
开发者ID:angmark0309,项目名称:remarket,代码行数:18,代码来源:2013_03_13_232334_insert_pics.php

示例15: action_delete

 public function action_delete()
 {
     if (Session::has('id') && Auth::check() && Input::has('file') && Input::has('listing_id')) {
         $account = Account::find(Session::get('id'));
         $listing = Listing::find(Input::get('listing_id'));
         $location = Location::find($listing->location_id);
         if ($account->id == $location->account_id) {
             unlink(Input::get('file'));
         } else {
             die("Image does not belogn to user");
         }
     }
 }
开发者ID:angmark0309,项目名称:remarket,代码行数:13,代码来源:image.php


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