本文整理汇总了PHP中CI_Model::getListByColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_Model::getListByColumn方法的具体用法?PHP CI_Model::getListByColumn怎么用?PHP CI_Model::getListByColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI_Model
的用法示例。
在下文中一共展示了CI_Model::getListByColumn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct()
{
parent::__construct();
// Load Base CodeIgniter files
$this->load->database();
$this->load->library('session');
$this->load->helper('url');
$this->load->helper('html');
$this->load->library('form_validation');
//Load models
$this->load->model('base_model');
$this->load->model('preferences/preference_model','preference');
// Load site wide modules
$this->load->library('status/status');
$this->load->library('site/bep_site');
$this->load->library('site/bep_assets');
$this->load->library('page/Page');
$this->load->library('auth/userlib');
// Load the SITE asset group
$this->bep_assets->load_asset_group('SITE');
// Get list parent categories
$model=new CI_Model();
$this->data['parents']=$model->getListByColumn('tn_categories','category_parent_id',0);
//set lang (auto)
$this->setLang();
// tuyet get facebook, twitter info,content tel
//$this->data['$cateProduct']=$model->getRowByColumn('tn_contact','category_name','')
$this->data['faceInfo']=$model->getRowByColumn('tn_info', 'info_name', 'facebook');
$this->data['twitterInfo']=$model->getRowByColumn('tn_info', 'info_name', 'twitter');
$this->data['movilInfo']=$model->getRowByColumn('tn_info', 'info_name', 'movil');
$this->data['telefonoInfo']=$model->getRowByColumn('tn_info', 'info_name', 'telefono');
// end tuyet
}
示例2:
?>
<div id="ja-col">
<div class="moduletable_menuhilite">
<h3><span><?php
if ($lang=='vn')
echo 'Danh mục sản phẩm';
else echo 'List product';
?>
</span> </h3>
<?php
if(isset($parents))
{
for ($i=0;$i<count($parents);$i++)
{
$num=$newModel->getListByColumn('mc_category','parent_id',$parents[$i]->id);
if(count($num)>0)
{
?><ul class="menu0">
<li>
<a style="cursor:pointer">
<?php
if ($lang=='vn')
echo $parents[$i]->namev;
else echo $parents[$i]->namee;
?>
</a>
</li>
<?php
$childs=$newModel->getListByColumn('mc_category','parent_id',$parents[$i]->id);
if (isset($childs))
示例3: if
<h2 style="font-family: Arial, Helvetica, sans-serif; font-size: 24px; color: #242424; font-weight: normal;">
<?php if ($_SESSION['lang']=="vn")
{?>
DANH MỤC
<?php } else{ ?>
CATEGORIES
<?php } ?>
</h2>
<ul id="list">
<?php
for ($i=0;$i<count($listcate);$i++)
{
if ($i%2==0)
{?>
<li class="color">
<a <?php $childs=$newModel->getListByColumn('mc_category','parent_id',$listcate[$i]->id);
if (count($childs)==0)
echo 'href="'.base_url().'sanpham/danhMuc/'.$listcate[$i]->id.'-'.$listcate[$i]->alias.'"';
?>>
<?php if ($_SESSION['lang']=="vn")
echo $listcate[$i]->namev;
else echo $listcate[$i]->namee;?>
</a>
<?php if (count($childs)>0)
{?>
<ul class="level2" style="float:left;list-style-type:none; box-shadow:0 2px 5px black; background-color:white">
<?php
foreach ($childs as $item)
{
if ($_SESSION['lang']=="vn")
echo '<li><a href="'.base_url().'sanpham/danhMuc/'.$item->id.'-'.$item->alias.'">'.$item->namev.'</a></li>';
示例4: if
?>
<style>
</style>
<div class="nav">
<!--menu vertical desplegable-->
<div class="line">
<div class="unit">
<div class="navMenu">
<ul class="menuLevel1">
<?php
if(isset($parents))
{
for ($i=0;$i<count($parents);$i++)
{
$listChildren=$newModel->getListByColumn('tn_categories','category_parent_id',$parents[$i]->category_id);
if(count($listChildren)>0)
{
?>
<li class="menuLevel1">
<a><?php if ($_SESSION['lang'] == 'en') echo $parents[$i]->category_name_e;
else echo $parents[$i]->category_name_v; ?></a>
<?php
if (isset($listChildren))
{ ?>
<ul class="menuLevel2">
<?php foreach($listChildren as $child)
{ ?>
<li><a href="<?php echo base_url() ?>danh-muc/<?php echo $child->category_id."-".$child->alias.'.htm' ?>">
<?php if ($_SESSION['lang'] == 'en') echo $child->category_name_e;
else echo $child->category_name_v; ?>
示例5: foreach
</h4>
<ul id="list">
<?php
foreach ($categories as $category) {
if ($_SESSION['lang'] == "vn") {
?>
<li class="slidecontrol" style="display:inline"><a <?php
echo 'href="' . base_url() . 'sanpham/category/' . $category->id . "-" . $category->alias . '"';
?>
class="type2" style="cursor:pointer">
<?php
echo $category->ten_v;
?>
</a>
<?php
$listlevel2 = $newmodel->getListByColumn('danhmuc', 'parent_id', $category->id);
?>
<?php
if (count($listlevel2) > 0) {
?>
<div class="slidemove">
<ul class="inside">
<?php
foreach ($listlevel2 as $level2) {
?>
<li><a class="menuleft-lv2" href="<?php
echo base_url();
?>
sanpham/category/<?php
echo $level2->id . "-" . $level2->alias;
?>