Code Monkey home page Code Monkey logo

cakephp-plugins-bootstrap4's People

Contributors

ali1 avatar lilhermit avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

cakephp-plugins-bootstrap4's Issues

Add 'type' of 'submit' to prepend/append buttons

via https://projects.lilhermit.co.uk/cakephp-plugins-bootstrap4/helpers/form.html#buttons you can append with the type of 'button', however <button> elements won't submit the form. This also needs the 'type' option of 'submit' so you could click the appended/prepended button and actually submit the form. The rendered html would look like so:

<div class="input-group">
	<input type="text" name="search" placeholder="Search for..." id="search" class="form-control">
	<div class="input-group-append">
		<button type="submit" class="btn btn-primary">Go</button>
	</div>
</div>

Checkbox field has no visible checked state in Layout type Grid

Originally reported by Anonymous


I think there are a bug with checkbox field on layout type grid form.

My current code is :

#!php

<?= $this->Form->create($menu, [
		'type' => 'post',
		'url' => ['controller' => 'menus', 'action' => 'edit', $menu->id],
		'layout' => ['type' => 'grid']
	]) ?>
<?= $this->Form->control('nom') ?>
<?= $this->Form->control('hook') ?>
<?= $this->Form->control('active') ?>
<?= $this->Form->button($this->Icon->i('save',''), ['class' => 'btn-success pull-right']); ?>	
<?= $this->Form->end(); ?>

And the checkbox field "active" (look attachment figure 1) has no visible checked state. When i click on the label, the square's style has no changing.

If i switch to layout type block or inline for form parameter, the bug is not present.

PS : I use last version 4.0.0.4001


Add ability to add custom classes to label templates

Originally reported by wilsmex (Bitbucket: wilsmex, GitHub: wilsmex)


Great plugin here. I'm wanting to build the 'horizontal' forms of BS4 instead of the vertical. This is trivial to do by adding a few classes, which I can use the custom templates to accomplish. The problem is that the 'label' template does not merge my class names. Any ideas?

#!php

<?php
return [
            'formGroup' => '{{label}}<div class="col-sm-10">{{input}}</div>',
            'inputContainer' => '<div class="form-group row">{{content}}{{help}}</div>',
            'inputContainerError' => '<div class="form-group row has-danger">{{content}}{{error}}{{help}}</div>',
            'label' => '<label{{attrs}} class="col-sm-2 text-right">{{text}}</label>',
];
?>

bootstrapCss/Script does not exist

With CakePHP 3.7.7 I followed the instruction here and here, but when the page loads it says:

Warning (512): Method Cake\View\Helper\HtmlHelper::bootstrapCss does not exist [CORE/src/View/Helper.php, line 117]
Warning (512): Method Cake\View\Helper\HtmlHelper::bootstrapScript does not exist [CORE/src/View/Helper.php, line 117]
Warning (512): Method Cake\View\Helper\HtmlHelper::button does not exist [CORE/src/View/Helper.php, line 117]

Is there something else I have to do?

cant bake with dev-master version

Wrote /home/johnneijzen/Documents/whereabouts/src/Template/Locations/add.ctp
PHP Fatal error: Cannot redeclare getColumn() (previously declared in /home/johnneijzen/Documents/whereabouts/tmp/bake/Bake-Element-form-ctp.php:32) in /home/johnneijzen/Documents/whereabouts/tmp/bake/Bake-Element-form-ctp.php on line 39
<CakePHPBakeOpenTagphp
/**

  • @var \App\View\AppView $this
  • @var \App\Model\Entity\Location $location
    */

$this->set('bakeEntities', array (
0 => 'Locations',
1 => 'Rooms',
2 => 'Buildings',
3 => 'Areas',
4 => 'Tasks',
));
CakePHPBakeCloseTag>

Fatal error: Cannot redeclare getColumn() (previously declared in /home/johnneijzen/Documents/whereabouts/tmp/bake/Bake-Element-form-ctp.php:32) in /home/johnneijzen/Documents/whereabouts/tmp/bake/Bake-Element-form-ctp.php on line 39

A little improvement in installation guide (documentation)

Originally reported by Juvenildo Vaz (Bitbucket: Juven_v, GitHub: Unknown)


In the installation guide / Configuring AppView could be have an example with initialize method (that is created by default in CakePHP). Something like that (or just a comment about):

#!php

namespace App\View;

use LilHermit\Bootstrap4\View\BootstrapView;

class AppView extends BootstrapView
{
    public function initialize()
    {
        parent::initialize();
    }
}

This is not a big problem, but makes me spend a lot of time trying figure out why plugin was not working properly.


Date format issues when html5Render is disabled

Originally reported by Thomas Georgiadis (Bitbucket: ThomasNucleus, GitHub: ThomasNucleus)


I have the following date field:

#!php

<?= 
$this->Form->control('date_of_birth', [
    'type' => 'date', 
    'html5Render' => false,
    'empty' => true, 
    'dateFormat' => 'DMY'
]);
?>

Having a couple issues which seem to only happen when html5Render is disabled:

First issue is I can't seem to change the format of the date. I'd like it to be DMY, however it always appears as YMD.

Second issue is the required attribute isn't being added to each of the inputs when html5Render is disabled. Required attribute is added if html5Render is enabled.


Possible bug with hidden fields and cakephp 3.7.3

I've found an error with Cakephp 3.7.3 and this plugin (v. 4002)

image

I've figured out how to "fix" it doing the follow:

in FormHelper.php, line 180 public function control($fieldName, array $options = []) {

Yo have to edit the following block

    $options += [
       'customControls' => $this->getConfig('customControls'),
       'html5Render' => $this->getConfig('html5Render'),
       'help' => false,
       'prepend' => false,
       'append' => false,
       'gridClasses' => $this->getConfig('layout.classes.grid')
   ];

Add 'required' => false

    $options += [
       'customControls' => $this->getConfig('customControls'),
       'html5Render' => $this->getConfig('html5Render'),
       'help' => false,
       'prepend' => false,
       'append' => false,
       'required'  => $this->getConfig('required'),
       'gridClasses' => $this->getConfig('layout.classes.grid')
   ];

cakephp/cakephp#12887

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.