<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] 模板引擎 (混合型)編譯原理 > 可以用框架里面的標簽、php原生代碼 編譯型模板引擎 ## 模板中代碼(混合): ``` <!--==========加關注彈出框==========--> <?php $group = M('group')->where(array('uid' => session('uid')))->select(); ?> <script type='text/javascript'> var addFollow = "{:U('Common/addFollow')}"; </script> <div id='follow'> <div class="follow_head"> <span class='follow_text fleft'>關注好友</span> </div> <div class='sel-group'> <span>好友分組:</span> <select name="gid"> <option value="0">默認分組</option> <foreach name='group' item='v'> <option value="{$v.id}">{$v.name}</option> </foreach> </select> </div> <div class='fl-btn-wrap'> <input type="hidden" name='follow'/> <span class='add-follow-sub'>關注</span> <span class='follow-cencle'>取消</span> </div> </div> <!--==========加關注彈出框==========--> ``` ## 編譯后的代碼: ``` <!--==========加關注彈出框==========--> <?php $group = M('group')->where(array('uid' => session('uid')))->select(); ?> <script type='text/javascript'> var addFollow = "<?php echo U('Common/addFollow');?>"; </script> <div id='follow'> <div class="follow_head"> <span class='follow_text fleft'>關注好友</span> </div> <div class='sel-group'> <span>好友分組:</span> <select name="gid"> <option value="0">默認分組</option> <?php if(is_array($group)): foreach($group as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; ?> </select> </div> <div class='fl-btn-wrap'> <input type="hidden" name='follow'/> <span class='add-follow-sub'>關注</span> <span class='follow-cencle'>取消</span> </div> </div> <!--==========加關注彈出框==========--> ``` ## 后臺處理 ``` /** * 異步添加關注 */ Public function addFollow () { if (!$this->isAjax()) { halt('頁面不存在'); } $data = array( 'follow' => $this->_post('follow', 'intval'), 'fans' => (int) session('uid'), 'gid' => $this->_post('gid', 'intval') ); if (M('follow')->data($data)->add()) { $db = M('userinfo'); $db->where(array('uid' => $data['follow']))->setInc('fans'); $db->where(array('uid' => session('uid')))->setInc('follow'); echo json_encode(array('status' => 1, 'msg' => '關注成功')); } else { echo json_encode(array('status' => 0, 'msg' => '關注失敗請重試...')); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看