# |
Jun 11th 2021, 09:10 |
kevin.pfeifer |
do you set the CSRF-Toke header? |
# |
Jun 11th 2021, 09:10 |
paolo.bragagni |
(it is an autocomplete function that i use for fill some search inputs) |
# |
Jun 11th 2021, 09:08 |
paolo.bragagni |
and if I fire manually the url I go to right controller |
# |
Jun 11th 2021, 09:08 |
paolo.bragagni |
GET "https://cakephp.local/cake4/cake4/autocomplete/fetch/Libri/titolo?term=la". |
# |
Jun 11th 2021, 09:08 |
paolo.bragagni |
I see |
# |
Jun 11th 2021, 09:08 |
paolo.bragagni |
if I debug the ajax call |
# |
Jun 11th 2021, 09:07 |
paolo.bragagni |
it worked in cake 2 :S |
# |
Jun 11th 2021, 09:05 |
paolo.bragagni |
probably |
# |
Jun 11th 2021, 09:05 |
paolo.bragagni |
hihi |
# |
Jun 11th 2021, 09:03 |
kevin.pfeifer |
in your JS code? |
# |
Jun 11th 2021, 09:01 |
paolo.bragagni |
where I have to see? |
# |
Jun 11th 2021, 09:01 |
paolo.bragagni |
my ajax call to controller is not fired |
# |
Jun 11th 2021, 08:34 |
kevin.pfeifer |
ndm is currently in the process of updating the friendsofcake/boostrap-ui plugin to bootstrap 5 https://github.com/FriendsOfCake/bootstrap-ui/pull/350 Maybe you can find something usefull there |
# |
Jun 11th 2021, 08:32 |
slackebot |
`'buttonToolbar' => '<div class="btn-toolbar{{attrs.class}}"{{attrs}}>{{content}}</div>',` `'fancyFileInput' => '{{fileInput}}<div class="input-group"><div class="input-group-btn">{{button}}</div>{{input}}</div>'` `];` `?>` |
# |
Jun 11th 2021, 08:32 |
slackebot |
`'inputGroupEnd' => '{{append}}</div>',` `'inputGroupAddons' => '<span class="input-group-addon">{{content}}</span>',` `'inputGroupButtons' => '<span class="input-group-btn">{{content}}</span>',` `'helpBlock' => '<p class="help-block">{{content}}</p>',` `'buttonGroup' => '<div class="btn-group{{attrs.class}}"{{attrs}}>{{content}}</div>',` |
# |
Jun 11th 2021, 08:32 |
slackebot |
class="form-group">{{submitContainerHorizontalStart}}{{content}}{{submitContainerHorizontalEnd}}</div>',` `'submitContainerHorizontal' => '<div class="form-group"><div class="{{inputColumnOffsetClass}} {{inputColumnClass}}">{{content}}</div></div>',` `'inputGroup' => '{{inputGroupStart}}{{input}}{{inputGroupEnd}}',` `'inputGroupStart' => '<div class="input-group">{{prepend}}',` |
# |
Jun 11th 2021, 08:32 |
slackebot |
name="{{name}}" value="{{value}}"{{attrs}}>',` `'inlineRadioWrapper' => '{{label}}',` `'inlineRadioNestingLabel' => '{{hidden}}<label{{attrs}} class="radio-inline">{{input}}{{text}}</label>',` `'textarea' => '<textarea name="{{name}}" class="form-control{{attrs.class}}" {{attrs}}>{{value}}</textarea>',` `'submitContainer' => '<div |
# |
Jun 11th 2021, 08:32 |
slackebot |
name="{{name}}[]" multiple="multiple" class="form-control{{attrs.class}}" {{attrs}}>{{content}}</select>',` `'radio' => '<input type="radio" name="{{name}}" value="{{value}}"{{attrs}}>',` `'radioWrapper' => '<div class="radio">{{label}}</div>',` `'radioContainer' => '<div class="form-group">{{content}}</div>',` `'inlineRadio' => '<input type="radio" |
# |
Jun 11th 2021, 08:32 |
slackebot |
`'optgroup' => '<optgroup label="{{label}}"{{attrs}}>{{content}}</optgroup>',` `'select' => '<select name="{{name}}" class="form-control{{attrs.class}}" {{attrs}}>{{content}}</select>',` `'selectColumn' => '<div class="col-md-{{columnSize}}"><select name="{{name}}" class="form-control{{attrs.class}}" {{attrs}}>{{content}}</select></div>',` `'selectMultiple' => '<select |
# |
Jun 11th 2021, 08:32 |
slackebot |
{{labelColumnClass}}{{attrs.class}}"{{attrs}}>{{text}}</label>',` `'labelInline' => '<label class="sr-only{{attrs.class}}"{{attrs}}>{{text}}</label>',` `'nestingLabel' => '{{hidden}}<label{{attrs}}>{{input}}{{text}}</label>',` `'legend' => '<legend>{{text}}</legend>',` `'option' => '<option value="{{value}}"{{attrs}}>{{text}}</option>',` |
# |
Jun 11th 2021, 08:32 |
slackebot |
{{type}}{{required}} mb-3">{{content}}</div>',` `'inputContainerError' => '<div class="form-group has-error {{type}}{{required}}">{{content}}{{error}}</div>',` `'label' => '<label {{attrs}} class="form-label text-primary" style="text-transform: uppercase">{{text}}</label>',` `'labelHorizontal' => '<label class="control-label |
# |
Jun 11th 2021, 08:32 |
slackebot |
class="{{inputColumnClass}}">{{prepend}}{{input}}{{append}}</div>',` `'hiddenBlock' => '<div style="display:none;">{{content}}</div>',` `'input' => '<input type="{{type}}" name="{{name}}" class="form-control{{attrs.class}}" {{attrs}} />',` `'inputSubmit' => '<input type="{{type}}"{{attrs}}>',` `'inputContainer' => '<div class="form-group |
# |
Jun 11th 2021, 08:32 |
slackebot |
error-message">{{content}}</span>',` `'errorHorizontal' => '<span class="help-block error-message {{errorColumnClass}}">{{content}}</span>',` `'errorList' => '<ul>{{content}}</ul>',` `'errorItem' => '<li>{{text}}</li>',` `'file' => '<input type="file" name="{{name}}" {{attrs}}>',` `'fieldset' => '<fieldset{{attrs}}>{{content}}</fieldset>',` |
# |
Jun 11th 2021, 08:32 |
slackebot |
`'formStart' => '<form{{attrs}}>',` `'formEnd' => '</form>',` `'formGroup' => '{{label}}{{prepend}}{{input}}<span class="help form-text text-muted small"><i class="fas fa-fw fa-question-circle"></i>andnbsp{{help}}</span>{{append}}<!-- formGroup help -->',` `'formGroupHorizontal' => '{{label}}<div |
# |
Jun 11th 2021, 08:32 |
slackebot |
class="mb-3">{{content}}</div>',` `'checkboxContainerHorizontal' => '<div class="form-group"><div class="{{inputColumnOffsetClass}} {{inputColumnClass}}"><div class="checkbox {{required}}">{{content}}</div></div></div>',` `'dateWidget' => '<div class="row">{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}{{meridian}}</div>',` `'error' => '<span class="help-block |
# |
Jun 11th 2021, 08:32 |
slackebot |
`'button' => '<button{{attrs}}>{{text}}</button>',` `'checkbox' => '<input class="form-check-input" type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>',` `'checkboxFormGroup' => '<label for="{{text}}" class="form-label">{{text}}</label>',` `'checkboxWrapper' => '<div class="form-check">{{label}}</div>',` `'checkboxContainer' => '<div |
# |
Jun 11th 2021, 08:32 |
tomrwaller |
Hey guys - in an attempt to avoid having to re-invent the wheel, I was wondering if anyone happened to have a Bootstrap 5 Form Helper template they are williing to share. The one I have is still Bootstrap 4 and things have changed a fair bit. Below is what I have already. Anyone able to share? Or even point me to one online? I've looked around quite a lot but had no joy so far. `<?php` `return [` |
# |
Jun 11th 2021, 08:27 |
kevin.pfeifer |
definitely :) |
# |
Jun 11th 2021, 08:27 |
paolo.bragagni |
:) |
# |
Jun 11th 2021, 08:27 |
paolo.bragagni |
(I was near) |
# |
Jun 11th 2021, 08:26 |
paolo.bragagni |
thanks |
# |
Jun 11th 2021, 08:23 |
kevin.pfeifer |
```$type = $this->Categories->getSchema()->getColumnType('id');``` |
# |
Jun 11th 2021, 08:19 |
paolo.bragagni |
in cake 2 I did this |
# |
Jun 11th 2021, 08:19 |
paolo.bragagni |
$this->loadModel($model); $tipo_colonna = $this->$model->getColumnType($field); |
# |
Jun 11th 2021, 08:19 |
paolo.bragagni |
in cake4 how to get the coloumn type of a filed? |
# |
Jun 11th 2021, 08:17 |
ovidiu.marinoiu |
cool, thanks! |
# |
Jun 11th 2021, 08:16 |
kevin.pfeifer |
@ovidiu.marinoiu you can get the “parent” Controller (from which you use the component) via `$controller = $this->getController();` Then you can access the model via that variable as if you were in the controller `$controller->MyModel->find()` But components are meant to be used by multiple controllers so you don’t always have the same controller |
# |
Jun 11th 2021, 08:05 |
ovidiu.marinoiu |
Hi! how can I import a model, in cakephp4, in a component. Found that in previous versions it was possible using ClassRegistry. |
# |
Jun 11th 2021, 05:17 |
paolo.bragagni |
(trying to make template with search function for index view) |
# |
Jun 11th 2021, 05:16 |
paolo.bragagni |
I have to built call back function that tests if input is numeric, or there are other easy ways? |
# |
Jun 11th 2021, 05:15 |
paolo.bragagni |
but if user enter string value I got an error |