定制 arodu/cakelte 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arodu/cakelte

最新稳定版本:v2.0.1

Composer 安装命令:

composer require arodu/cakelte

包简介

CakeLTE: AdminLTE plugin for CakePHP

README 文档

README

Latest Version CakePHP Packagist License GitHub Repo stars Total Downloads

If it's helpful you can buy me a coffee, thanks!

ko-fi

Getting Started

Dependencies

Installing

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require arodu/cakelte

Configuration

You can load the plugin using the shell command:

bin/cake plugin load CakeLte

add AdminLTE symlink to webroot

bin/cake cakelte install

How to use

Copy the file vendor/arodu/cakelte/config/cakelte.php to config/cakelte.php

cp vendor/arodu/cakelte/config/cakelte.php config/cakelte.php

In this file you can change the cakelte configuration options

use trait into src/View/AppView.php (Recomended)

namespace App\View;

use Cake\View\View;
use CakeLte\View\CakeLteTrait;

class AppView extends View{
  use CakeLteTrait;

  public string $layout = 'CakeLte.default';

  public function initialize(): void{
      parent::initialize();
      $this->initializeCakeLte();
      //...
  }
}

or you can extends from CakeLteView

namespace App\View;

use Cake\View\View;
use CakeLte\View\CakeLteView;

class AppView extends CakeLteView{

  public function initialize(): void{
    parent::initialize();
    //...
  }
}

Options layouts

  • CakeLte.default
  • CakeLte.login
  • CakeLte.top-nav

Create code from bake

bin/cake bake all [command] -t CakeLte

bin/cake bake template [command] -t CakeLte login
bin/cake bake template [command] -t CakeLte register
bin/cake bake template [command] -t CakeLte recovery

To modify the template you can copy one or all the files within your project, copying the following files in the folder templates/plugin/CakeLte/ and keeping the same structure of templates/

Replace the files elements

  • Layouts
    • templates/layout/default.php
    • templates/layout/login.php
    • templates/layout/top-nav.php
  • Content
    • templates/element/content/header.php
  • Header navbar
    • templates/element/header/main.php
    • templates/element/header/menu.php
    • templates/element/header/messages.php
    • templates/element/header/notifications.php
    • templates/element/header/search-default.php
    • templates/element/header/search-block.php
  • Footer
    • templates/element/footer/main.php
  • Left sidebar
    • templates/element/sidebar/main.php
    • templates/element/sidebar/menu.php
    • templates/element/sidebar/search.php
    • templates/element/sidebar/user.php
  • Right sidebar
    • templates/element/aside/main.php

Or you can use the following command to copy all files

bin/cake cakelte copy_files --all

Page debug

Link to debug

echo $this->Html->link(__('CakeLTE debug page'), '/cake_lte/debug' );

// {your-url}/cake_lte/debug

Page Debug with default layout

Page Debug with top-nav layour

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 24.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 36
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 35
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-18