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