tp5 前台 点击显示一个弹窗

例子

tp5 前台 点击显示一个弹窗_第1张图片

1.静态



{foreach name="recruitment" item="vo"}

{$vo.special}

工作职责:


{$vo.description}



点击查看>>>


{/foreach}


tp5 前台 点击显示一个弹窗_第2张图片

2.js




function openWind(tit,w,h,url)
{
$.dialog({
title:tit,
width:w+"px",
height:h+"px",
content:'url:'+url,
fixed:false
});
}

tp5 前台 点击显示一个弹窗_第3张图片

 3.控制器内

namespace app\home\controller;
use app\home\model\RecruitmentModel;
use think\Controller;
use think\Db;

class Recruitment extends Base
{
public function recruitment(){
$recruitment = Db::name('recruitment')->select();
$this -> assign('recruitment',$recruitment);
return $this->fetch();
}


public function getData(){
$id = input('param.id');
$model = new RecruitmentModel();
$result = $model->getIntro($id);
$this->assign('result',$result);
return $this->fetch();
}
}

tp5 前台 点击显示一个弹窗_第4张图片

4.模型内

namespace app\home\model;
use think\Model;
use think\Db;

class RecruitmentModel extends Model
{
public function getKuang($id){
$goods = $this->where('id',$id)->find();
}


public function getIntro($id){
return Db::name('recruitment')->where('id',$id)->find();
}

}

tp5 前台 点击显示一个弹窗_第5张图片

 

转载于:https://www.cnblogs.com/dennyxiao/p/8441482.html

你可能感兴趣的:(tp5 前台 点击显示一个弹窗)