ahmedebead / cakelte

此包已被弃用且不再维护。作者建议使用ahmedebead/cakephp-4-lte包。

CakePHP 4.x AdminLTE 3.1 主题。

安装: 4

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

语言:JavaScript

类型:cakephp-plugin

3.3 2021-08-12 04:17 UTC

This package is auto-updated.

Last update: 2021-12-05 21:10:58 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

RTL Support

新闻动态

CakephpLte已更新到版本3.1.0。

CakePHP已更新到与4.2.0兼容的版本。

安装

您可以使用composer进行安装。

composer require ahmedebead/cakephp-4-lte

复制资源

执行以上命令后,运行此命令

bin/cake plugin assets symlink

启用插件

// src/Application.php

public function bootstrap()
{
    $this->addPlugin('CakephpLte', ['autoload' => true, 'bootstrap' => true, 'routes' => true]);
}

启用主题

// src/Controller/AppController.php
use Cake\Event\EventInterface;

public function beforeRender(EventInterface  $event)
{
    $this->viewBuilder()->setTheme('CakephpLte');
    $this->viewBuilder()->setClassName('CakephpLte.CakephpLte');
}

启用表单

// src/View/AppView.php

public function initialize()
{
    $this->loadHelper('Form', ['className' => 'CakephpLte.Form']);
    $this->loadHelper('Paginator', ['templates' => 'CakephpLte.paginator-templates']);

}

配置

// new config/cakephplte.php file

return [
    'CakephpLteTheme' => [
        'title' => 'CakephpLte',
        'logo' => [
            'mini' => '<b>AE</b>LT',
            'large' => '<b>Admin</b>LTE'
        ],
        'login' => [
            'show_remember' => true,
            'show_register' => true,
            'show_social' => true
        ],
        'folder' => ROOT,
        'skin' => 'blue'
    ]
];

// config/bootstrap.php

Configure::load('cakelte', 'default');

RTL 支持

RTL Support

只需将 rtl css 和 js 添加到您的布局中(如果您已覆盖它)

// Css
     <!-- Bootstrap 4 rtl -->
     echo $this->Html->css('CakephpLte./css/bootstrap.rtl.min.css'); 
     <!-- Custom CSS rtl -->
     echo $this->Html->css('CakephpLte./css/rtl.css'); 

// JS
     <!-- Bootstrap 4 rtl -->
     echo $this->Html->script('CakephpLte./js/bootstrap.rtl.min.js'); 

或使用 rtl 布局

$this->layout = 'CakephpLte.rtl';

功能

布局

有2个布局文件。

  • default 它是主布局
  • rtl

RTL 支持

视图块

有3个块,您可以在其中扩展您的 CakephpLteTheme。

  • css
<?php echo $this->fetch('css'); ?>

一个例子是 src/Template/Pages/home.ctp

<?php echo $this->Html->css('CakephpLte./bower_components/morris.js/morris', ['block' => 'css']); ?>
  • script
<?php echo $this->fetch('script'); ?>

一个例子是 src/Template/Pages/home.ctp

<?php echo $this->Html->script('CakephpLte./bower_components/morris.js/morris.min', ['block' => 'script']); ?>
  • scriptBottom
<?php echo $this->fetch('scriptBottom'); ?>

一个例子是 src/Template/Pages/home.ctp

<?php $this->start('scriptBottom'); ?>
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
<?php  $this->end(); ?>

元素

有7个元素文件。

  • Element/
    • aside/
      • form
      • sidebar-menu
      • user-panel
    • aside-control-sidebar
    • aside-main-sidebar
    • breadcrumb
    • footer
    • nav-top

Flash 消息

主题已准备好显示 Flash 消息。

<?php echo $this->Flash->render(); ?>
<?php echo $this->Flash->render('auth'); ?>

Bake

这是 Cake 最好的功能之一。主题已准备好使用 Bake。

bin/cake bake all user --theme CakephpLte

视图

  • CakephpLteView

这是主题最好的功能之一。它改变了 Cake 显示视图文件的模式。

基本上,您可以覆盖任何主题、插件和前缀文件。

  1. src/Template/Plugin/$theme/Plugin/$plugin/$prefix/
  2. src/Template/Plugin/$theme/Plugin/$plugin/
  3. src/Template/Plugin/$theme/$prefix/
  4. src/Template/Plugin/$theme/

FormHelper

FormHelper 默认基于 Foundation 模板格式化模板。此助手会覆盖这些模板。

行为

  • DatepickerBehavior

当您将App.defaultLocale配置为pt_BR时,此行为会被使用。

区域设置

当您将App.defaultLocale配置为pt_BR时,此区域设置会被使用。

页面调试

添加了对 CakePHP 默认页面的链接。

Depug page

贡献

  1. 进行分支复制
  2. 创建您的功能分支(git checkout -b my-new-feature
  3. 提交您的更改(git commit -am '添加某些功能'
  4. 推送到分支(git push origin my-new-feature
  5. 创建新的 Pull Request