随笔分类 -  开发框架

摘要:一、表设计 user表 group表 user_group表 二、模型设计 User模型 <?php namespace app\index\model; class Users extends \think\Model { protected $pk = "id"; protected $auto 阅读全文
posted @ 2024-11-22 09:41 样子2018 阅读(6) 评论(0) 推荐(0) 编辑
摘要:一、安装think-auth composer require 5ini99/think-auth 二、数据表 -- -- think_auth_rule,规则表, -- id:主键,name:规则唯一标识, title:规则中文名称 status 状态:为1正常,为0禁用,condition:规则 阅读全文
posted @ 2024-02-02 15:38 样子2018 阅读(58) 评论(0) 推荐(0) 编辑
摘要:一、创建控制器 <?php namespace app\common\taglib; use think\auth\Auth; use think\template\TagLib; class MyTag extends TagLib { protected $tags = [ 'auth' => 阅读全文
posted @ 2024-02-02 15:17 样子2018 阅读(59) 评论(0) 推荐(0) 编辑
摘要:一、文档 https://learnku.com/docs/laravel/6.x/eloquent-relationships/5177#d9e83d 二、实例 1、表结构 admin表 role表 auth表 role_auth表 2、模型 admin.php <?php /** * Creat 阅读全文
posted @ 2023-11-11 10:49 样子2018 阅读(41) 评论(0) 推荐(0) 编辑
摘要:一、配置 1、找到同版本的laravel下的\vendor\laravel\framework\src\Illuminate\Cookie目录下的文件拷贝到lumen的\vendor\illuminate\cookie目录下 二、使用 $cookie = \Symfony\Component\Htt 阅读全文
posted @ 2023-11-11 09:31 样子2018 阅读(24) 评论(0) 推荐(0) 编辑
摘要:一、设置 1、新建Libs/function.php 2、在app.php中引入function.php 阅读全文
posted @ 2023-10-20 14:28 样子2018 阅读(19) 评论(0) 推荐(0) 编辑
摘要:一、配置 1、在\app\bootstrap\app.php中取消注释 $app->withFacades(); $app->withEloquent(); $app->routeMiddleware([ 'auth' => App\Http\Middleware\Authenticate::cla 阅读全文
posted @ 2023-10-13 10:20 样子2018 阅读(80) 评论(0) 推荐(0) 编辑
摘要:一、基本操作 1、/database/migrations/ 目录下生成一个php文件,这个文件主要包括两个函数,在up()函数中根据你的需求定义数据库字段 php artisan make:migration create_users_table --create=users <?php use 阅读全文
posted @ 2023-10-13 09:59 样子2018 阅读(40) 评论(0) 推荐(0) 编辑
摘要:一、修改Lumen 1、打开bootstrap/app.php,在相应位置添加注册SessionServiceProvider $app->register(Illuminate\Session\SessionServiceProvider::class); 2、同样在bootstrap/app.p 阅读全文
posted @ 2023-10-12 16:10 样子2018 阅读(41) 评论(0) 推荐(0) 编辑
摘要:一、代码 /** * @throws \think\Exception */ protected function getDb(){ if(!$this->my_db){ $this->my_db = Db::connect(config('db2')); } } config.php 阅读全文
posted @ 2022-08-27 14:42 样子2018 阅读(142) 评论(0) 推荐(0) 编辑
摘要:下载地址:https://github.com/yangsphp/tprbac-v2-master 一、效果图 阅读全文
posted @ 2022-07-18 13:17 样子2018 阅读(54) 评论(0) 推荐(0) 编辑
摘要:1、配置.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_ 阅读全文
posted @ 2022-02-17 08:40 样子2018 阅读(72) 评论(0) 推荐(0) 编辑
摘要:一、示例代码 public function html() { return Response::create($this->fetch('setting'), 'html')->code(200); } 阅读全文
posted @ 2021-05-04 13:49 样子2018 阅读(413) 评论(0) 推荐(0) 编辑
摘要:一、更新 二、效果图 阅读全文
posted @ 2020-04-15 08:42 样子2018 阅读(403) 评论(0) 推荐(0) 编辑
摘要:一、更新 2020-08-28 修复admin/model/admin.php代码 2020-04-14 修复账号启用问题 2020-04-09 初版本完成 二、效果图 三、获取源码 注意:部署配置虚拟主机 QQ:2575404985 微信:yangyang92428 github:https:// 阅读全文
posted @ 2020-04-09 21:26 样子2018 阅读(2481) 评论(0) 推荐(0) 编辑
摘要:一、截图 二、解决 修改application\database.php // 数据集返回类型 'resultset_type' => 'array', 改为 // 数据集返回类型 'resultset_type' => 'collection', 阅读全文
posted @ 2020-03-27 14:52 样子2018 阅读(9579) 评论(0) 推荐(0) 编辑
摘要:一、创建配置文件 在application/extra目录下创建white.php 二、读取配置文件 $white = Config::get('white'); 阅读全文
posted @ 2020-03-27 14:42 样子2018 阅读(588) 评论(0) 推荐(0) 编辑
摘要:一、效果图 二、代码 public function articlePage() { $cat_id = $this->input->get("catid"); $search = $this->input->get("search"); $current_page = intval($this-> 阅读全文
posted @ 2020-03-07 11:36 样子2018 阅读(391) 评论(0) 推荐(0) 编辑
摘要:一、效果图 二、代码 <?php /** * Created by PhpStorm. * User: 25754 * Date: 2020/3/5 * Time: 15:46 */ defined('BASEPATH') OR exit('No direct script access allow 阅读全文
posted @ 2020-03-07 11:29 样子2018 阅读(335) 评论(0) 推荐(0) 编辑
摘要:一、建立合理的目录结构 admin与home为后台和前台的控制器和模板文件夹 二、定义前后台视图路径常量 在constants.php中添加如下代码: //定义前台视图路径常量 define('HOME_VIEW_DIR', 'views/home/'); //定义后台视图路径常量 define(' 阅读全文
posted @ 2019-02-16 14:10 样子2018 阅读(1051) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示