本文整理匯總了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);
}
示例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('警告:非法操作!');
}
}