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


PHP Model_Ad::getAdListAll方法代码示例

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


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

示例1: listallAction

 /**
  * List all ads
  */
 public function listallAction()
 {
     $this->view->userRole = $this->_helper->checkUserRole->check();
     $model = new Model_Ad();
     $ad_type = $this->view->ad_type = $this->_request->getParam('ad_type');
     if ($ad_type == 'give') {
         $this->view->page_title .= $this->view->translate('give') . ' ';
         $type = 'give';
     } elseif ($ad_type == 'want') {
         $this->view->page_title .= $this->view->translate('want') . ' ';
         $type = 'want';
     } else {
         //dont accept other values than give/want
         $this->_helper->_flashMessenger->addMessage($this->view->translate('this url does not exist'));
         $this->_redirect('/' . $this->lang . '/ad/listall/ad_type/give', array('code' => 301));
     }
     $status = $this->_request->getParam('status');
     $f = new Zend_Filter();
     $f->addFilter(new Zend_Filter_HtmlEntities());
     $status = $f->filter($status);
     if ($status) {
         $this->view->page_title .= $this->view->translate($status) . ' ';
     }
     $this->view->ad = $model->getAdListAll($ad_type, $status);
     $this->view->page_title .= $this->view->translate('All the ads') . ' ' . $this->view->translate('second hand and new');
     //paginator
     $page = $this->_getParam('page');
     if ($page) {
         $this->view->page_title .= ' ' . $this->view->translate('page') . ' ' . $page;
     }
     //add meta description to head
     $this->view->metaDescription = $this->view->page_title . '. ' . $this->view->translate('nolotiro.org is a website where you can give away things you no longer want or no longer need to pick them up other people who may serve or be of much use.');
     $paginator = Zend_Paginator::factory($this->view->ad);
     $paginator->setDefaultScrollingStyle('Elastic');
     $paginator->setItemCountPerPage(20);
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
 }
开发者ID:Arteaga2k,项目名称:nolotiro,代码行数:41,代码来源:AdController.php


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