ahmedebead/cakephp-4-lte

CakePHP 4.x AdminLTE 3.1 主题。

安装次数: 836

依赖项: 0

建议者: 0

安全: 0

星标: 3

关注者: 1

分支: 0

公开问题: 0

语言:JavaScript

类型:cakephp-plugin

2.0.1 2021-12-05 20:58 UTC

This package is auto-updated.

Last update: 2024-09-06 03:23:42 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/

表单助手

表单助手默认基于 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 'Add some feature'
  4. 将分支推送到远程(git push origin my-new-feature
  5. 创建新的 Pull Request