Git Product home page Git Product logo

cakephp4-bootstrap-helpers's Introduction

CakePHP 4.x Helpers for Bootstrap

Software License Travis Packagist

CakePHP 4.x Helpers to generate HTML with @Twitter Boostrap style: Breadcrumbs, Flash, Form, Html, Modal, Navbar, Card and Paginator helpers available!

How to... ?

Installation

If you want the Bootstrap 4 version of the plugin:

  • Add the plugin to your composer.json:
# Stable version:
composer require holt59/cakephp3-bootstrap-helpers:4.0.3
$this->loadHelper('Html', [
    'className' => 'Bootstrap.Html',
    // Other configuration options...
]);

Breaking changes from previous versions

  • FormHelper:

    • it is not possible to place error message in a separate column in horizontal form, the error message will always be put below the input.
  • NavbarHelper:

    • the following options of the create() methods have been removed or have had their meaning changed:
      • static is now sticky
      • responsive has been dropped and replace by a collapse option with the following meaning: true for always collapsed, false for never collapsed, or a string representing indicating when the content should collapse ('lg' is the default).
      • fluid has been dropped.
      • container is a new option (bool, default is false) to indicate if the content of the navbar should be wrapped inside a <div class="container"></div>.
      • inverse has been dropped.
    • a new theme option has been added to the create() method to control, possible values are 'light', 'dark', false (no theme), or an array [$theme, $bg].
    • when adding a link() to an inner menu, the $linkOptions parameters is not usable anymore and the $options parameters should be used directly (their are no wrapping <li> anymore for inner menu).

The full plugin documentation is available at https://cakephp-bootstrap.github.io/cakephp3-bootstrap-helpers/.

Table of version and requirements

Version Bootstrap version CakePHP version Information
master 3 >= 3.7.0 Current active V3 branch.
4.0.3 4 >= 3.7.0 Current active V4 branch.
4.0.2 4 >= 3.7.0 Latest V4 release.
3.1.4 3 >= 3.7.0 Open issue(s) if necessary.
<= 3.1.2 3 < 3.4.0 Deprecated.

Contributing

Do not hesitate to post a github issue or submit a pull request if you find a bug or want a new feature.

Who is using it?

Non-exhaustive list of projects using these helpers, if you want to be in this list, do not hesitate to email me or post a comment on this issue.

Copyright and license

The MIT License (MIT)

Copyright (c) 2013-2020, Mikaël Capelle.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

See LICENSE.

cakephp4-bootstrap-helpers's People

Contributors

alphp avatar erwane avatar fullybaked avatar grouse avatar holt59 avatar innovaweb-dev avatar jd-robbs avatar jmenges avatar keraf avatar lyz452 avatar oxicode avatar raul338 avatar sharkooon avatar starlocke avatar toggenation avatar wreality avatar ypnos avatar ypnos-web avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cakephp4-bootstrap-helpers's Issues

Call to undefined method Bootstrap\View\Widget\DateTimeWidget::_normalizeData

This is a (multiple allowed):

  • bug

  • enhancement

  • question

  • CakePHP Version: 4.0.10

  • Plugin Version/Branch: "holt59/cakephp4-bootstrap-helpers": "v3.0.0.x-dev"

What you did & What happened

While migrating from CakePHP 3.8 to CakePHP 4.0, I switched to using this "cakephp4" helper. When I load an "edit" page that contains a "date" field, the system runs into an error complaining about Call to undefined method Bootstrap\View\Widget\DateTimeWidget::_normalizeData() because CakePHP has removed _normalizeData() from the DateTimeWidget on Dec 17, 2018 with commit e88d4c91c9002590d85062b478968c38ec6713eb

What you expected to happen

DateTimeWidget within cakephp4-bootstrap-helpers is no longer needed, as far as I can tell. Just a straight rendering of a native <input type="date"> should be fine from now on.

Bootstrap 5 development -- FriendsOfCake/bootstrap-ui

This is a (multiple allowed):

  • bug

  • enhancement

  • question

  • CakePHP Version: 4.3.8

  • Plugin Version/Branch: N/A

Hi, I currently use https://github.com/FriendsOfCake/bootstrap-ui to do essentially what this plugin does. However, I like the CardHelper from this plugin.

I've also noticed that there is not a Bootstrap 5 version of this plugin. Would it makes sense to cherry pick certain files (eg. CardHelper) from here and just add it to that repository? Rather than reworking this plugin for bootstrap 5 and that one needing to develop the Helpers from this one.

I've created a similar discussion on that repository: FriendsOfCake/bootstrap-ui#374

PHP Fatal error: A function with return type must return a value

This is a (multiple allowed):

  • bug

  • enhancement

  • question

  • CakePHP Version: 4.3.5

What you did

I'm in progress of migrating CakePHP 3.x app into CakePHP 4.x
I have updated composer.json with:

"holt59/cakephp4-bootstrap-helpers": "^3.0",

What happened

PHP error message:

Fatal error: A function with return type must return a value (did you mean "return null;" instead of "return;"?) in ./vendor/holt59/cakephp4-bootstrap-helpers/src/View/Helper/FlashHelper.php on line 37

What you expected to happen

No errors :)

FlashHelper incompatible with CakePHP 4

This is a (multiple allowed):

  • bug

  • enhancement

  • question

  • PHP Version: 8.1

  • CakePHP Version: 4.4.3

  • Plugin Version/Branch: v4.x-dev

What you did

Tried to load FlashHelper

What happened

Fatal error: Declaration of Bootstrap\View\Helper\FlashHelper::render($key = 'flash', array $options = []) must be compatible with Cake\View\Helper\FlashHelper::render(string $key = 'flash', array $options = []): ?string in /application/vendor/holt59/cakephp4-bootstrap-helpers/src/View/Helper/FlashHelper.php on line 33

What you expected to happen

No Fatal Errors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.