當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tool::objArrOfStr方法代碼示例

本文整理匯總了PHP中Tool::objArrOfStr方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tool::objArrOfStr方法的具體用法?PHP Tool::objArrOfStr怎麽用?PHP Tool::objArrOfStr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tool的用法示例。


在下文中一共展示了Tool::objArrOfStr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show

 private function show()
 {
     $this->_tpl->assign('show', true);
     $this->_tpl->assign('title', 'Article List');
     $this->nav();
     $_nav = new NavModel();
     if (empty($_GET['nav'])) {
         $_id = $_nav->getAllNavChildId();
         $this->_model->nav = Tool::objArrOfStr($_id, 'id');
     } else {
         $_nav->id = $_GET['nav'];
         if (!$_nav->getOneNav()) {
             Tool::alertBack('nav not existing');
         }
         $this->_model->nav = $_nav->id;
     }
     parent::page($this->_model->getListContentTotal());
     $_object = $this->_model->getListContent();
     Tool::subStr($_object, 'title', 20, null);
     $this->_tpl->assign('SearchContent', $_object);
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:21,代碼來源:ContentAction.class.php

示例2: getListContent

 private function getListContent()
 {
     if (isset($_GET['id'])) {
         parent::__construct($this->_tpl, new ContentModel());
         $_nav = new NavModel();
         $_nav->id = $_GET['id'];
         $_navid = $_nav->getNavChildId();
         if ($_navid) {
             $this->_model->nav = Tool::objArrOfStr($_navid, 'id');
         } else {
             $this->_model->nav = $_nav->id;
         }
         parent::page($this->_model->getListContentTotal(), ARTICLE_SIZE);
         $_object = $this->_model->getListContent();
         Tool::subStr($_object, 'info', 120, 'utf-8');
         Tool::subStr($_object, 'title', 35, 'utf-8');
         if ($_object) {
             foreach ($_object as $_value) {
                 if (empty($_value->thumbnail)) {
                     $_value->thumbnail = 'images/none.jpg';
                 }
             }
         }
         $this->_tpl->assign('AllListContent', $_object);
         $_object = $this->_model->getMonthNavRec();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavRec', $_object);
         $_object = $this->_model->getMonthNavHot();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavHot', $_object);
         $_object = $this->_model->getMonthNavPic();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavPic', $_object);
     } else {
         Tool::alertBack('警告:非法操作!');
     }
 }
開發者ID:denson7,項目名稱:phpstudy,代碼行數:37,代碼來源:ListAction.class.php


注:本文中的Tool::objArrOfStr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。