
thinkphp5
HD2killers
这个作者很懒,什么都没留下…
展开
-
反转义var_dump
适用于 array相关讨论$str = <<<strarray(1) { [0] => array(25) { ["catid"] => int(1) ["type"] => int(0) ["modelid"] => int(0) ["domain"] => NULL转载 2019-03-18 16:28:06 · 432 阅读 · 0 评论 -
think-worker计时器
安装#在项目根目录执行以下指令composer require topthink/think-worker 在项目根目录创建服务启动文件 server.php&amp;amp;amp;amp;lt;?phpdefine('APP_PATH', __DIR__ . '/application/');define(&amp;amp;amp;quot;BIND_MODULE&amp;amp;amp;quot;, &am转载 2018-08-20 17:43:30 · 724 阅读 · 0 评论 -
PhpSpreadsheet 保存excel文件
读取excel blog 安装composer require phpoffice/phpspreadsheet 例子&amp;amp;lt;?phpnamespace app\index\controller;use PhpOffice\PhpSpreadsheet\Spreadsheet;use PhpOffice\PhpSpreadsheet\Writer\...原创 2018-08-20 14:12:44 · 3600 阅读 · 0 评论 -
TP5实践
配置文件用common方法来读取 * 防止以后配置文件的数据库可更改性 *原创 2018-08-12 20:54:40 · 196 阅读 · 0 评论 -
angular的处理方式
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt; &lt;!-- &lt;script src='__STATIC__/js/jquery.min.js' type="text/javascript"&gt;&lt;/script&gt; --原创 2018-08-12 14:03:30 · 225 阅读 · 0 评论 -
验证码获取
/** * 验证码获取 */ use think\Verify; public function verify() { //验证码类型 $type = I('get.type') ? I('get.type') : 'user_login'; $config = array( ...原创 2018-08-12 09:35:42 · 558 阅读 · 0 评论 -
php快捷导出excel文件
读取数据,生成table $orderList = Db::query($query); $strTable = '&amp;amp;amp;lt;table width=&amp;amp;quot;500&amp;amp;quot; border=&amp;amp;quot;1&amp;amp;quot;&amp;amp;amp;gt;'; $strT原创 2018-08-14 10:46:03 · 188 阅读 · 0 评论 -
使用layUI分页ajax数据,way.js数据双向绑定
前端&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;link rel="stylesheet" type="text/css&q原创 2018-07-28 11:11:13 · 1011 阅读 · 0 评论 -
是使用layUI渲染表格(方法渲染)
前端<!DOCTYPE html><html><head> <title></title> <link rel="stylesheet" type="text/css" href="./layui/css/layui.css?t=20180403-1"&原创 2018-07-27 16:28:26 · 1553 阅读 · 0 评论 -
上拉加载数据结构
前端使用mescroll 网站 githubvar mescroll = new MeScroll("mescroll", { //第一个参数"mescroll"对应上面布局结构div的id //如果您的下拉刷新是重置列表数据,那么down完全可以不用配置,具体用法参考第一个基础案例 //解析: down.callback默认调用mescroll.reset...原创 2018-07-27 14:52:26 · 258 阅读 · 0 评论 -
获取ip地理环境的api
程序 public function index() { $api_url = 'http://ip.taobao.com/service/getIpInfo.php'; $ip = '125.85.206.146'; $get_url = $api_url . '?ip=' . $ip; $r...原创 2018-07-26 17:04:05 · 162 阅读 · 0 评论 -
ajax提交整个表单包含file类型文件
表单<form class="center with-shadow indent-on-large-phone" id="new_entry" accept-charset="UTF-8" method="post" enctype="multipart/form-data"> <div class="field field-text-f原创 2018-09-03 16:45:46 · 508 阅读 · 0 评论 -
thinkphp5.0*使用php-cli模式推送队列
安装框架和扩展think-queuecomposer create-project topthink/think=5.0.* tp50 --prefer-distcd tp50composer require topthink/think-queue 队列设置# 配置使用redis, tp50/application/extra/queue.php&lt;?phpret...原创 2018-09-20 10:19:26 · 1048 阅读 · 0 评论 -
未认证公众号接入公众号支付
记录一次未认证公众号接入公众号支付话虽这样说,实际必须有一个已经认证且已经可以使用微笑公众号支付的公众号A公众号B没有认证,调用支付全部使用公众号A的参数(AppID,AppSecrect,paySignKey,MCHID)公众号B参数,使用自己的return_url和notify_url再到公众号A公众平台设置:网页授权域名(公众号B的域名)再到公众号A商户平台设置:支付授权目录...原创 2018-09-20 12:14:04 · 1215 阅读 · 0 评论 -
ThinkPHP5.0.*版本 cli模式下php每隔段时间就出错
关于ThinkPHP5.0.*版本 cli模式下php每隔段时间就出错cli模式下php每隔段时间就出错官方论坛日志如下:# 控制台Uncaught think\exception\ErrorException: Error while sending STMT_CLOSE packet. PID=23951 in /www/web/feibao_luhong421_com/publ...原创 2018-11-05 10:09:02 · 2975 阅读 · 0 评论 -
快充宝接入
快充宝&amp;lt;?phpnamespace app\index\controller;use think\Controller;use think\Db;class Miaochongbao extends Controller{ function return () { # 使用前提 # # 1、支付宝扫描给你的二维...原创 2018-11-07 12:17:06 · 580 阅读 · 0 评论 -
WDCP配置ThinkPHP伪静态隐藏index.php,解决重定向次数过多
修改文件项目入口文件# 把tp50项目public目录所有文件复制到public_html,修改index.php入口文件路径,所有的..修改为当前目录/配置nginx配置# 在wdcp里面,文件管理&gt;nginx配置(文件: /www/wdlinux/nginx/conf/vhost/feibao.xxx.com.conf,.wdcp结尾的不用修改),修改配置如下:# 注意...原创 2018-11-02 16:19:07 · 2567 阅读 · 0 评论 -
appnode不使用站点管理器,直接用nginx建站
配置tp5环境原文server { listen 80; server_name logo.lxx123.club; # 注意根目录的权限,否之403 root /vhs/www/phpzcool/public/; index index.html index.htm index.php; # 隐藏ind...原创 2018-11-02 13:39:39 · 1485 阅读 · 0 评论 -
关于网站支付
支付使用Yansongda\Pay\Payhttps://github.com/yansongda/paycomposer require yansongda/pay -vvv支付宝wap支付&amp;amp;amp;lt;?phpnamespace app\index\controller;use think\Controller;use think\Db;use Yansongda\Pay\P...原创 2018-10-19 15:55:05 · 797 阅读 · 0 评论 -
grafika制作分享二维码图片
&amp;lt;?phpnamespace app\index\controller;use Grafika\Color;use Grafika\Grafika;use think\Controller;/** * composer require kosinix/grafika * https://github.com/kosinix/grafika/ */class Sharec...原创 2018-10-19 13:47:14 · 657 阅读 · 0 评论 -
使用Endroid\QrCode生成二维码
&lt;?phpnamespace app\index\controller;use Endroid\QrCode\ErrorCorrectionLevel;use Endroid\QrCode\QrCode as QrCodeExt;use think\Controller;/** * php713 * php.ini扩展 * extension=gd * extensi...原创 2018-10-19 12:22:11 · 5606 阅读 · 0 评论 -
PHP通过pcntl扩展使用redis队列多进程爬虫
重要扩展pcntl(推荐使用linux系统)redis扩展而且配置mysql,redis服务器以及扩展程序# phantomjs需要使用二进制文件composer require jaeger/querylist-phantomjscomposer require jaeger/querylist # 可以不用composer require jaeger/queryl...原创 2018-10-08 17:22:36 · 714 阅读 · 0 评论 -
Grafika处理图像,显示推广码
安装 githubcomposer require kosinix/grafika 使用use Grafika\Color;use Grafika\Grafika; /** * 获取用户的推广图片 * @param integer $uid [UID] * @param string $text [姓名...原创 2018-07-26 16:40:44 · 746 阅读 · 0 评论 -
缓存(或者session)生成短信验证码
<?phpnamespace app\common\smslxx;use think\Cache;/** * * * Class Smslxx * 使用缓存,缓存键前缀sms * @package app\common\smslxx */class Smslxx{ const CODE_LENTH = 4; //验证码长度,最大9 const ...原创 2018-07-26 16:22:28 · 863 阅读 · 0 评论 -
TP5接入快递查询api
安装PHP Wrapper for KuaiDi100. githubcomposer require xu42/kuaidi100 使用<?phpnamespace app\index\controller;use think\Controller;use Xu42\KuaiDi100\KuaiDi100;class TrackCode exte...原创 2018-07-26 16:07:31 · 1288 阅读 · 0 评论 -
kangle 搭建tinkphp5 实践
使用KangLe搭建tp5环境1. 伪静态设置(?s=)[还是在根目录.htaccess]&lt;IfModule mod_rewrite.c&gt;Options +FollowSymlinks -MultiviewsRewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENA...原创 2018-06-04 23:23:46 · 754 阅读 · 0 评论 -
cache 缓存定时清除
清除缓存的时间是早上8点// 清除缓存的时间是早上8点 $clear_time = strtotime("8:00:00"); $space_time = strtotime("23:59:00"); $now_time = strtotime(date("H:i:s", time())); $cache_time = $cl...原创 2018-05-17 11:32:15 · 1795 阅读 · 0 评论 -
使用 PHPMailer 配合 QQ邮箱 发送邮件
// 开启php_openssl以及php_sockets&lt;?php/** * Created by PhpStorm. * Date: 2018/4/23 * Time: 23:14 */namespace app\common\sendingpay;use \think\Controller;use app\common\phpmailer\PHPMailer...原创 2018-04-24 00:18:25 · 377 阅读 · 0 评论 -
H-ui.admin wellcome
{extend name="template/base" /} {block name="title"}我的桌面{/block} {block name="content"}<div class="page-container"> <p class="f-20 text-success">欢迎使用 {$Think.config.site.nam原创 2018-04-22 09:29:08 · 702 阅读 · 0 评论 -
thinkphp5 使用pjax 如果是pjax就局部,否则调用资源文件
使用pjax{php}\think\Request::instance()->isPjax()?'include APP_PATH."wap/view/pub/assetsnone.html";':include APP_PATH."wap/view/pub/assets.html"; {/php}原创 2018-03-24 11:43:36 · 1334 阅读 · 0 评论 -
thinkphp5 extend目录扩展类的使用
类所在路径:\extend\mikkle\tp_wxpay\WxPayConf_pub.php在其他类里面使用:use \mikkle\tp_wxpay\WxPayConf_pub as WxPayConf;as重新指定类名,便于实例化;在方法中使用:$wxpayconf= new WxPayConf();$wxpayconf->function();...原创 2018-03-13 21:08:46 · 7203 阅读 · 0 评论 -
thinkphp5 使用阿里大于短息验证 短信仍使用自带captcha生成
1.修改captcha扩展类库,放置(覆盖)到:\vendor\topthink目录(附件think-captcha.zip);2.新建控制器到Sms.php:\application\api\controller;内容:<?phpnamespace app\api\controller;use think\Db;use think\Controller;use think\Requ...原创 2018-03-13 20:55:27 · 336 阅读 · 0 评论 -
ueditor数据库显示到前端使用转码
$ret = DB::connect('db_lite')->table('lxx_users')->where('id',7)->select(); $trans = array_flip(get_html_translation_table(HTML_ENTITIES)); $comtent = strtr($ret[0]['comtent']...原创 2018-03-18 13:19:13 · 638 阅读 · 0 评论 -
tp5视图使用链接跳转
&lt;a href="{:url('index/index/usersingup','id=10&amp;m=10')}"&gt;&lt;span class="singup"&gt;立即注册&lt;/span&gt;&lt;/a&gt;原创 2018-03-15 13:55:43 · 3382 阅读 · 0 评论 -
tpadmin合成推广二维码
合成推广二维码$img_url = $this->getCode("{$userId}"); $name = ROOT_PATH."/public/code/" . $this->get_random(); $code_filename = \File::downloadImage($img_url, $name);...原创 2018-03-15 12:28:46 · 253 阅读 · 0 评论 -
PHP(ThinkPHP)批量导出vcf(vcard)名片
thinkphp 使用类库导出cvf GitHub:vcard 安装composer require jeroendesloovere/vcard 例子&lt;?phpnamespace app\index\controller;use JeroenDesloovere\VCard\VCard as RequVcard;use think\Db;c...原创 2018-06-13 11:30:30 · 1689 阅读 · 0 评论 -
关于tp5的pjax布局方案
index.html&lt;!doctype html&gt;&lt;html&gt; &lt;head&gt; &lt;title&gt; 管理中心 &lt;/title&gt; {include file='pub/headcss' /}原创 2018-06-14 09:58:41 · 1121 阅读 · 0 评论 -
tp5使用curl特性进行定时多线程爬虫(或任务),使用redis队列
利用php-(开源工具)实现爬虫流程说明-从数据库或者循环构建爬虫的url(包括分页参数) -分段取出 -2Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 ...原创 2018-06-01 11:58:28 · 3124 阅读 · 0 评论 -
TP5接入阿里云通信短信
主程序&amp;lt;?phpnamespace app\api\controller;// 来自官方require_once VENDOR_PATH . 'aliyun-dysms-php-sdk/api_sdk/vendor/autoload.php';use Aliyun\Api\Sms\Request\V20170525\SendSmsRequest;use Aliyun...原创 2018-07-26 15:56:44 · 1226 阅读 · 0 评论 -
微信公众号创建菜单目录数组结构
$data = [ 'button' =&gt; [ 0 =&gt; [ 'name' =&gt; '商城首页', 'url' =&gt; 'http://m.luhong421.com/Mobile/Index/lxx_test.html', ...原创 2018-07-26 11:34:25 · 701 阅读 · 0 评论