好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

emlog MVC解构22--控制器Controller之Tag_Controller

Tag_Controller控制器用于输出标签文章列表,仅有一个方法:display($params)。

function display($params) {
    // 建立日志模型
    $Log_Model = new Log_Model();
    // 建立配置缓存
    $options_cache = Option::getAll();
    // 配置缓存数组键名转换成变量,键值转换成对应的变量值
    extract($options_cache);
    
    // 获取页码,路径未包含则设置为1
    $page = isset($params[4]) && $params[4] == 'page' ? abs(intval($params[5])) : 1;
    // 获取标签名,路径未包含则设置为空
    $tag = isset($params[1]) && $params[1] == 'tag' ? addslashes(urldecode(trim($params[2]))) : '';
    
    // 定义访问路径
    $pageurl = '';
    
    // 设置标签页面站点标题为标签名-站点浏览器标题
    $site_title = stripslashes($tag) . ' - ' . $site_title;
    
    // 建立标签模型
    $Tag_Model = new Tag_Model();
    // 通过标签名称获取包含此标签的日志ID以逗号分隔的字符串
    $blogIdStr = $Tag_Model->getTagByName($tag);
    
    // 标签不包含在任意日志则输出404页面
    if ($blogIdStr === false) {
        show_404_page();
    }
    // 设置数据库搜索条件,从新到旧排列结果
    $sqlSegment = "and gid IN ($blogIdStr) order by date desc";
    // 获取包含标签的日志数量
    $lognum = $Log_Model->getLogNum('n', $sqlSegment);
    
    // 获取标签列表的总页数
    $total_pages = ceil($lognum / $index_lognum);
    if ($page > $total_pages) { // 页码超过总页数
        // 页码设为最后一页
        $page = $total_pages;
    }
    // 利用工具类Url获取标签页面链接
    $pageurl .= Url::tag(urlencode($tag), 'page');
    
    
    // 获取日志列表数组
    $logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);
    // 利用工具函数获取输出列表页底部页码导航的字符串
    $page_url = pagination($lognum, $index_lognum, $page, $pageurl);
    
    // View调用前台模板header.php和log_list.php输出标签列表页面
    include View::getView('header');
    include View::getView('log_list');
}


点赞0
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
intellalegal
 intellalegal 2019-02-15 06:08回复
#81
<a href="http://www.teamdalarna.com/femminile-air-max-90-em-nero-rosso-scarpel">femminile air max 90 em nero rosso</a> <a href="http://www.syairshamyoun.com/nike-air-max-infrared-velvet-shoesj">nike air max infrared velvet</a> <a href="http://www.fizalisfresh.com/michael-kors-bedford-belted-hobo-mkh">michael kors bedford belted hobo</a> <a href="http://www.fsscas.com/nike-sb-stefan-janoski-max-kvinners-s%C3%B8lv-oransje-obuvi">nike sb stefan janoski max kvinners s酶lv oransje</a> <a href="http://www.imagimp.com/maschio-nike-cortez-arancia-rosso-scarpej">maschio nike cortez arancia rosso</a> <a href="http://www.burmamaritime.com/womens-nike-air-max-95-green-grey-shoesh">womens nike air max 95 green grey</a>
intellalegal http://www.intellalegal.com/
myoastudies
 myoastudies 2019-02-14 22:31回复
#80
<a href="http://www.feelsafeinc.com/nfl-brice-butler-youth-limited-red-jersey-12-arizona-cardinals-nike-home-vapor-untouchable-nfls">nfl brice butler youth limited red jersey 12 arizona cardinals nike home vapor untouchable</a> <a href="http://www.gaeconomics.com/ralph-lauren-hoodies-green-navy-polot">ralph lauren hoodies green navy</a> <a href="http://www.garagesetcinc.com/nike-limited-12th-fan-jersey-nfl-seattle-seahawks-2017-salute-to-service-mens-olive-camo-nflz">nike limited 12th fan jersey nfl seattle seahawks 2017 salute to service mens olive camo</a> <a href="http://www.paleofasting.com/lebron-12-lifestyle-tout-rouge-kurpesc">lebron 12 lifestyle tout rouge</a> <a href="http://www.revarepair.com/nike-shaun-alexander-jersey-37-nfl-seattle-seahawks-long-sleeve-t-shirt-name-number-logo-navy-blue-nflz">nike shaun alexander jersey 37 nfl seattle seahawks long sleeve t shirt name number logo navy blue</a> <a href="http://www.saraviquez.com/adidas-climacool-ride-ii-gr%C3%B8nn-obuvd">adidas climacool ride ii gr酶nn</a>
myoastudies http://www.myoastudies.com/
davidmgaines
 davidmgaines 2019-02-14 21:26回复
#79
<a href="http://www.theislandbody.com/air-jordan-retro-1-femmes-violet-oranger-chaussuresh">air jordan retro 1 femmes violet oranger</a> <a href="http://www.zululeads.com/disney-star-wars-hat-hatl">disney star wars hat</a> <a href="http://www.notmyrichie.com/nike-air-max-tailwind-8-femmes-jaune-blanc-chaussuresh">nike air max tailwind 8 femmes jaune blanc</a> <a href="http://www.mintyschoice.com/adidas-zx-630-verde-gris-zapatosp">adidas zx 630 verde gris</a> <a href="http://www.mamapjblog.com/nike-free-run-3-grey-silver-shoesi">nike free run 3 grey silver</a> <a href="http://www.pdfunicorn.com/dam%C3%A4nner-nike-roshe-run-triangle-rot-gelb-schuhei">dam盲nner nike roshe run triangle rot gelb</a>
[url=http://www.davidmgaines.com/]davidmgaines[/url]
mengenmetal
 mengenmetal 2019-02-13 05:21回复
#78
<a href="http://www.acforlessllc.com/nike-air-max-2019-green-uk-shoeso">nike air max 2019 green uk</a> <a href="http://www.thehodostore.com/jordan-retro-7-rose-and-gris-kurpesb">jordan retro 7 rose and gris</a> <a href="http://www.gandoff.com/adidas-equipment-running-suport-eqt-cq2991-zapatost">adidas equipment running suport eqt cq2991</a> <a href="http://www.langbenlang.com/converse-femme-all-star-blanche-shoesz">converse femme all star blanche</a> <a href="http://www.glennloovens.com/adidas-zx-flux-p%C3%BArpura-rosado-schuheb">adidas zx flux p煤rpura rosado</a> <a href="http://www.kamilotomotiv.com/mens-nike-cleveland-browns-26-derrick-kindred-limited-olivecamo-2017-salute-to-service-nfl-jersey-nflu">mens nike cleveland browns 26 derrick kindred limited olivecamo 2017 salute to service nfl jersey</a>
mengenmetal http://www.mengenmetal.com/
maxpectations
 maxpectations 2019-02-12 03:08回复
#77
<a href="http://www.totulesteaici.com/jordan-1-negro-mettodasic-oro-2017-obuva">jordan 1 negro mettodasic oro 2017</a> <a href="http://www.zcardnigeria.com/ralph-lauren-coats-gr%C3%BCn-braun-polot">ralph lauren coats gr眉n braun</a> <a href="http://www.ascautoparts.com/nike-free-3.0-v4-herre-sko-gr%C3%A5-s%C3%B8lv-platinum-card-schuhed">nike free 3.0 v4 herre sko gr氓 s酶lv platinum card</a> <a href="http://www.croquenreve.com/air-jordan-retro-5-laney-for-vendita-scarpec">air jordan retro 5 laney for vendita</a> <a href="http://www.emoizmir.com/nfl-womens-nike-new-orleans-saints-71-ryan-ramczyk-black-camo-salute-to-service-t-shirt-nflw">nfl womens nike new orleans saints 71 ryan ramczyk black camo salute to service t shirt</a> <a href="http://www.fabrikatrav.com/womens-nike-pittsburgh-steelers-78-alejandro-villanueva-white-vapor-untouchable-limited-player-nfl-jersey-nflz">womens nike pittsburgh steelers 78 alejandro villanueva white vapor untouchable limited player nfl jersey</a>
maxpectations http://www.maxpectations.com/
texarillo
 texarillo 2019-02-11 04:34回复
#76
<a href="http://www.mumbaikichut.com/air-jordan-retro-7-himmelblau-grau-schuheh">air jordan retro 7 himmelblau grau</a> <a href="http://www.ikmsdkravmaga.com/nike-air-max-blue-laces-shoesq">nike air max blue laces</a> <a href="http://www.themusinglens.com/new-york-mets-strawberry-jersey-nfli">new york mets strawberry jersey</a> <a href="http://www.startagencia.com/nike-kd-8-kvinners-himmelen-bl%C3%A5-svart-obuvp">nike kd 8 kvinners himmelen bl氓 svart</a> <a href="http://www.drjennieward.com/gallery-womens-coach-madison-coachh">gallery womens coach madison</a> <a href="http://www.genievres.com/air-jordan-horizon-viola-gituttio-scarpei">air jordan horizon viola gituttio</a>
texarillo http://www.texarillo.com/
tatilblogu
 tatilblogu 2019-02-10 18:59回复
#75
<a href="http://www.theislandbody.com/nike-lebron-ambassador-9-grey-pink-shoesj">nike lebron ambassador 9 grey pink</a> <a href="http://www.zululeads.com/air-jordan-retro-12-gr%C3%A5-r%C3%B8d-skoi">air jordan retro 12 gr氓 r酶d</a> <a href="http://www.notmyrichie.com/nike-air-max-grigio-pietra-scarpel">nike air max grigio pietra</a> <a href="http://www.mintyschoice.com/nike-air-max-bw-yellow-grey-shoesj">nike air max bw yellow grey</a> <a href="http://www.mamapjblog.com/michael-kors-hamilton-bag-redmichael-kors-cynthia-satchel-coral-open-mkh">michael kors hamilton bag redmichael kors cynthia satchel coral open</a> <a href="http://www.pdfunicorn.com/nike-zoom-pegasus-32-kvinners-r%C3%B8d-gul-obuvi">nike zoom pegasus 32 kvinners r酶d gul</a>
tatilblogu http://www.tatilblogu.com/
radioramabc
 radioramabc 2019-02-09 08:26回复
#74
<a href="http://www.colintilley.com/nike-kobe-8-gr%C3%B8n-guld-skoj">nike kobe 8 gr酶n guld</a> <a href="http://www.xthbgc.com/kvinners-nike-zoom-structure-18-hvit-gr%C3%A5-obuvi">kvinners nike zoom structure 18 hvit gr氓</a> <a href="http://www.iberishop.com/air-yeezy-ii-2-sp-max-90-mujeres-rosado-negro-zapatosk">air yeezy ii 2 sp max 90 mujeres rosado negro</a> <a href="http://www.karmacanix.com/herre-nike-air-max-lunar-1-alle-lilla-skoq">herre nike air max lunar 1 alle lilla</a> <a href="http://www.tobepartridge.com/femminile-air-jordan-retro-13-grigio-blu-scarpeh">femminile air jordan retro 13 grigio blu</a> <a href="http://www.shopdunks.com/maschio-nike-roshe-run-slip-blu-gituttio-scarpei">maschio nike roshe run slip blu gituttio</a>
radioramabc http://www.radioramabc.com/
veronicaloman
 veronicaloman 2019-02-09 02:10回复
#73
<a href="http://www.allyoucanlike.com/nike-hyperdunk-marron-violet-butyc">nike hyperdunk marron violet</a> <a href="http://www.avonew.com/adidas-porsche-design-v-blu-obuvf">adidas porsche design v blu</a> <a href="http://www.manavocat.com/hommes-asics-gel-noosa-tri-10-jaune-orange-kurpesa">hommes asics gel noosa tri 10 jaune orange</a> <a href="http://www.mjnonghyup.com/nike-free-run-3-kvinders-lyser%C3%B8d-kurpese">nike free run 3 kvinders lyser酶d</a> <a href="http://www.opticgambetta.com/hommes-ralph-lauren-pony-polo-vert-violet-polou">hommes ralph lauren pony polo vert violet</a> <a href="http://www.reigapfunding.com/asics-gel-kayano-20-gelb-schwarz-scarpeb">asics gel kayano 20 gelb schwarz</a>
veronicaloman http://www.veronicaloman.com/
miendiation
 miendiation 2019-02-08 22:40回复
#72
<a href="http://www.bhcsboosters.com/air-jordan-retro-29-red-green-sneakere">air jordan retro 29 red green</a> <a href="http://www.denisgoulart.com/nike-zoom-pegasus-33-kvinders-bl%C3%A5-lyser%C3%B8d-obuvc">nike zoom pegasus 33 kvinders bl氓 lyser酶d</a> <a href="http://www.donggeomdo.com/nike-mens-shilique-calhoun-limited-white-jersey-oakland-raiders-nfl-91-rush-vapor-untouchable-nflw">nike mens shilique calhoun limited white jersey oakland raiders nfl 91 rush vapor untouchable</a> <a href="http://www.ozoessaouira.com/2014-15-chelsea-fc-26-terry-home-soccer-shirt-kit-nflv">2014 15 chelsea fc 26 terry home soccer shirt kit</a> <a href="http://www.annomaplexel.com/silver-white-mens-nike-free-5.0-2014-shoes-skog">silver white mens nike free 5.0 2014 shoes</a> <a href="http://www.bringribben.com/roshe-run-pattern-peach-skob">roshe run pattern peach</a>
miendiation http://www.miendiation.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸