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