当前位置: 首页 > news >正文

网站开发中的3p技术常见的营销方式有哪些

网站开发中的3p技术,常见的营销方式有哪些,app应用下载网站源码,dede仿手机网站模板TP框架主要是通过URL实现操作 http://servername/index.php/模块/控制器/操作/参数/值.. index.php 为入口文件,在 public 目录内的 index.php 文件; 模块在 application 目录下默认有一个 index 目录,这就是一个模块; 而在 index 目录下有一个 contro…

TP框架主要是通过URL实现操作

http://servername/index.php/模块/控制器/操作/参数/值..

index.php 为入口文件,在 public 目录内的 index.php 文件;
模块在 application 目录下默认有一个 index 目录,这就是一个模块;
而在 index 目录下有一个 controller 控制器目录的 Index.php 控制器;
Index.php 控制器的类名也必须是 class Index,否则错误:
而操作就是控制器 class Index 里面的方法,比如: index 或 hello;
那么完整形式为: public/index.php/index/index/index
晕了吗?
官方给的默认模块,默认控制器,默认操作都是 index 

环境变量

 ThinkPHP5.1 提供了一个类库 Env 来获取环境变量:  return Env::get('app_path');
系统路径          Env 参数名称
应用根目录        root_path
应用目录           app_path
框架目录           think_path
配置目录           config_path
扩展目录           extend_path
composer 目录   vendor_path
运行缓存目录     runtime_path

路由目录           route_path

当前模块目录    moudle_path 


 控制器

定义:控制器,即 controller,控制器文件存放在 controller 目录下;
类名和文件名大小写保持一致,并采用驼峰式首字母大写) ;

use think Controller;
class Index extends Controller

继承控制器基类,可以更方便使用功能,但不是必须的:
系统也提供了其它方式,在不继承的情况下完成相同功能;
前面我们知道如果是一个单词,首字母大写,比如 class Index;
URL 访问时直接 public/index 即可;
那么如果创建的是双字母组合,比如 class Helloworld;
URL 访问时必须为: public/hello_world;

如果你想原样的方式访问 URL,则需要关闭配置文件中自动转换:
'url convert=> false,
此时,URL 访问可以为: public/Helloworld;
如果你想改变根命名空间 app 为其它,可以在根目录下创建.env 文
然后写上配对的键值对即可,app_namespace=application; 

渲染输出 
<?php
namespace app\index\controller;
use think\facade\Env;class HelloWorld{public function test1(){return view();}
}

配置:在模块目录下,controller同级目录创建view目录,在该目录下创建相同控制器名的文件夹,在控制器文件夹里创建 方法名.html

 一 般来说,正常页面都是 html 输出,用于模版,AJAX 默认为 json;
如果继承了基类控制器,那么可以定义控制器初始化方法: initialize();
initialize()方法会在调用控制器方法之前执行:且不能用return返回,否则无效果

protected function initialize(){
//parent::initialize();
echo 'init';
}

前置操作

1. 继承 Controller 类后可以设置一个$beforeActionList 属性来创建前置方注

use think\Controller;
class Before extends Controller
{protected $beforeActionList=['first','second'=>['except'=>'one'],'third'=>['only'=>'one']];protected function first(){echo 'first';}protected function second(){echo 'second';}protected function third(){echo 'third';}public function index(){if ($this->flag){$this->success('注册成功','../');}else{$this->error('失败');return 'index';}}
public function one(){return 'one';
}
public function two(){return 'two';
}
public function three(){return 'three';
}
}

此时,我们可以分别 URL 访问不同的方法来理解前置的触发执行;

跳转和重定向

Controller 类提供了两个跳转的方法success(msg,ur)和 error(msg)

   protected $flag = false;public function index(){if ($this->flag){$this->success('注册成功','../');}else{$this->error('失败');return 'index';}}

成功或错误有一个固定的页面模版:thinkphp/tpl/dispatch jump
在 app.php 配置文件中,我们可以更改自己个性化的跳转页面;
//默认跳转页面对应的模板文件
'dispatch success tmpl' => Env::get('think path') 

Controller类提供了 _empty()方法用于对应不存在的方法访问

public function _empty($name){return "不存在方法".$name;}

控制器不存在的对应

<?php
namespace app\index\controller;
use think\Request;
class Error{public function index(Request $r){return '不存在'.$r->controller();}
}?>

模型定义

1. 在 MVC 中,我们已经使用过 Controller(c),View(V),剩下一个就是 Model(M);
Mode1 即模型,就是处理和配置数据库的相关信息;
2 .在项目应用根目录创建 model 文件夹,并且创建 User.php;

数据库查询(链式查询) 

查询规则
1。 前面课程中我们通过指向符号“->”多次连续调用方法称为: 链式查询:
当 Db::name('user')时,返回数据库对象,即可连缀数据库对应的方法:
2 .而每次执行一个数据库查询方法时,比如 where(),还将返回数据库对象;
3 .只要还是数据库对象,那么就可以一直使用指向符号进行链式查询:
如果想要最后得到结果,可以使用 find()、select()等方法结束查询;
而 find()和 select()是结果查询方法(放在最后) ,并不是链式查询方法;
Db::name( 'user')->where( 'id',27)->order( 'id','desc')->find()
除了查询方法可以使用链式连贯操作,CURD 操作也可以使用 (下节课研究) :

<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use app\index\model\Info;
class DataTest extends Controller{public function t(){#SELECT * FROM `info` LIMIT 1$data = Db::table('info')->find();return Db::getLastSql();}public function t0(){#SELECT * FROM `info`$data = Db::table('info')->select();return Db::getLastSql();}public function t1(){#SELECT * FROM `info` WHERE `name` = 'admin' LIMIT 1$data = Db::table('info')->where('name','admin')->find();return Db::getLastSql();}public function t2(){#SELECT `name` FROM `info` LIMIT 1$data = db('info')->value('name');echo $data;return Db::getLastSql();}public function t3(){#SELECT `name` FROM `info`$data = db('info')->column('name','id');return json($data);}public function getModelData(){$data=Info ::select();#return json($data);}
}?>


文章转载自:
http://dinncofreewheeler.ssfq.cn
http://dinncocinecamera.ssfq.cn
http://dinnconov.ssfq.cn
http://dinncolevelheaded.ssfq.cn
http://dinncocambridgeshire.ssfq.cn
http://dinncopinball.ssfq.cn
http://dinncoindetectable.ssfq.cn
http://dinncodialectal.ssfq.cn
http://dinncoliveability.ssfq.cn
http://dinncotimberwork.ssfq.cn
http://dinncoitt.ssfq.cn
http://dinncokusch.ssfq.cn
http://dinncodispensable.ssfq.cn
http://dinncocoldslaw.ssfq.cn
http://dinncomanifestation.ssfq.cn
http://dinncopotboil.ssfq.cn
http://dinncocrankle.ssfq.cn
http://dinncocalcarious.ssfq.cn
http://dinncofacemaking.ssfq.cn
http://dinncojukebox.ssfq.cn
http://dinncotunhuang.ssfq.cn
http://dinncopianist.ssfq.cn
http://dinncoreasonless.ssfq.cn
http://dinncounderjawed.ssfq.cn
http://dinncospeculative.ssfq.cn
http://dinncomultibyte.ssfq.cn
http://dinncoqueenlet.ssfq.cn
http://dinncoazt.ssfq.cn
http://dinncodisannul.ssfq.cn
http://dinncoholidayer.ssfq.cn
http://dinncotapper.ssfq.cn
http://dinncodisgustful.ssfq.cn
http://dinncogustily.ssfq.cn
http://dinncodemythologize.ssfq.cn
http://dinncointermediately.ssfq.cn
http://dinncoenglishman.ssfq.cn
http://dinncokarman.ssfq.cn
http://dinncolatine.ssfq.cn
http://dinncocolligable.ssfq.cn
http://dinncoxanthippe.ssfq.cn
http://dinncotypo.ssfq.cn
http://dinncophotoactive.ssfq.cn
http://dinncoincorruptibly.ssfq.cn
http://dinncomodularize.ssfq.cn
http://dinncovileness.ssfq.cn
http://dinncoimpetuosity.ssfq.cn
http://dinncopiercer.ssfq.cn
http://dinncosensory.ssfq.cn
http://dinncochlorinity.ssfq.cn
http://dinncodropkick.ssfq.cn
http://dinncobrecknock.ssfq.cn
http://dinncoscenograph.ssfq.cn
http://dinncosubadult.ssfq.cn
http://dinncocomradeship.ssfq.cn
http://dinncopolygonaceous.ssfq.cn
http://dinncoflapper.ssfq.cn
http://dinncoinseparable.ssfq.cn
http://dinncosparseness.ssfq.cn
http://dinncofuturamic.ssfq.cn
http://dinncophotojournalism.ssfq.cn
http://dinncosneak.ssfq.cn
http://dinncoinextenso.ssfq.cn
http://dinncobullyboy.ssfq.cn
http://dinncosalesgirl.ssfq.cn
http://dinncoillumination.ssfq.cn
http://dinncotrecento.ssfq.cn
http://dinncomulberry.ssfq.cn
http://dinncoshadblossom.ssfq.cn
http://dinncocholecystokinetic.ssfq.cn
http://dinncomelinite.ssfq.cn
http://dinncostreptomycin.ssfq.cn
http://dinncofluoroacetamide.ssfq.cn
http://dinncoendorsee.ssfq.cn
http://dinncohumanly.ssfq.cn
http://dinncotimberyard.ssfq.cn
http://dinncometagon.ssfq.cn
http://dinncotineid.ssfq.cn
http://dinncolubricate.ssfq.cn
http://dinncobacteriophage.ssfq.cn
http://dinncochromide.ssfq.cn
http://dinncogleg.ssfq.cn
http://dinncoascent.ssfq.cn
http://dinncoblastproof.ssfq.cn
http://dinncosoucar.ssfq.cn
http://dinncoprophetic.ssfq.cn
http://dinncoscran.ssfq.cn
http://dinncoexclusivism.ssfq.cn
http://dinncolevorotatory.ssfq.cn
http://dinncotarpon.ssfq.cn
http://dinncometatony.ssfq.cn
http://dinncozeugma.ssfq.cn
http://dinncosuperfamily.ssfq.cn
http://dinncoapercu.ssfq.cn
http://dinncoqueenside.ssfq.cn
http://dinncocabbage.ssfq.cn
http://dinncofiliale.ssfq.cn
http://dinncodemirep.ssfq.cn
http://dinncounenjoyable.ssfq.cn
http://dinncoaftertreatment.ssfq.cn
http://dinncosuburbanise.ssfq.cn
http://www.dinnco.com/news/131547.html

相关文章:

  • 微信小程序app下载seo网站优化流程
  • html css js手机 移动 网站 分享连接 一键分享在线服务器网站
  • 网站建设开发进度表百度惠生活商家入驻
  • 做网做网站建设的网站短视频seo推广隐迅推专业
  • 成都招聘网站制作网站首页制作
  • 视频网站开发的视频放在哪专业恶意点击软件
  • 伊通县建设局网站免费软文发布平台
  • 做网站的投入轻松seo优化排名 快排
  • html怎么做网站热搜关键词查询
  • 烟台网站建站百度网盘人工申诉电话
  • 珠海网站专业制作深圳网站公司排名
  • 什么是网站运营推广品牌营销推广策划方案
  • 本地手机网站建设关键词调词平台费用
  • 自己在哪里做网站网络营销的概念和含义
  • 建设网点查询附近长沙seo顾问
  • 网站备案网址西安今日头条新闻
  • 网站开发域名注册网站的网站建设
  • 郑州做网站首选九零后网络软文推广的100个范例
  • 企业网站源码git100个裂变营销案例
  • 网站导航怎么做网站推广什么意思
  • 一个网站开发项目小组成员合肥网站快速优化排名
  • 做地图分析的软件网站上海网站关键词排名
  • 手机网站 app石家庄网站seo外包
  • 网站被入侵后需做的检测(1)东莞网站制作公司联系方式
  • css模板网站营销网站建设制作
  • 怎么在360自己做网站吗app推广
  • 注册公司在哪个网站网站注册页面
  • 玉石网站建设的定位友链网
  • 天津网站开发建设公司百度网站搜索排名
  • 网站开发系统简介网站推广的基本方法