# |
Nov 19th 2019, 08:37 |
challgren |
*Woah* _formatting_ ~options~ |
# |
Nov 19th 2019, 08:37 |
neon1024 |
If you wanted `?string` or `?int` for example |
# |
Nov 19th 2019, 08:37 |
neon1024 |
To constrain a scalar value |
# |
Nov 19th 2019, 08:36 |
neon1024 |
I belive omitting a rule would allow `null` values, as well as `allowEmpty` although some of the empty type rules have been updated in recent releases I think to be things like `allowEmptyArray` or similar |
# |
Nov 19th 2019, 08:35 |
val |
Thanks. Is there a way to allow `null` except using `allowEmpty`? |
# |
Nov 19th 2019, 08:34 |
neon1024 |
https://api.cakephp.org/3.8/class-Cake.Validation.Validator.html |
# |
Nov 19th 2019, 08:33 |
neon1024 |
@val The valiation rules are listed in the api |
# |
Nov 19th 2019, 08:33 |
neon1024 |
Ooh, did *someone* enable _formatting_ options? |
# |
Nov 19th 2019, 08:33 |
neon1024 |
Morning all |
# |
Nov 19th 2019, 08:30 |
javier.villanueva |
morning |
# |
Nov 19th 2019, 08:28 |
val |
Hi, where can I find a list of core validation rules for 3.x like https://book.cakephp.org/2/en/models/data-validation.html#core-validation-rules? |
# |
Nov 19th 2019, 07:43 |
pieceof |
> jp5421 make sure to use method:post |
# |
Nov 19th 2019, 06:44 |
conehead |
And make sure your route is setup correctly if you do not follow the standards |
# |
Nov 19th 2019, 06:43 |
conehead |
@johnpaul5421 Just use `$form->create` once and inspect the html object in your browser. You will see how the link will have to look like |
# |
Nov 18th 2019, 20:44 |
johnpaul5421 |
any ideas for the form to send the data through the action to the controller? This is without using echo $form->create and echo $form->submit('Save'); |
# |
Nov 18th 2019, 20:32 |
johnpaul5421 |
I still get object not found, The requested URL was not found on this server. error 404. |
# |
Nov 18th 2019, 20:26 |
johnpaul5421 |
sorry " " > the remainder I forgot to type. |
# |
Nov 18th 2019, 20:26 |
johnpaul5421 |
e.g. shopping_carts for ShoppingCartsController and the public function name in ShoppingCartsController is add. |
# |
Nov 18th 2019, 20:25 |
johnpaul5421 |
<form method="post" id="form" action="/shopping_carts/add |
# |
Nov 18th 2019, 20:24 |
johnpaul5421 |
thanks michaelze, I keep getting this url cannot be found on the server hmm. |
# |
Nov 18th 2019, 19:56 |
michaelze |
And maybe rethink the "not using the FormHelper" part of your question... :slightly_smiling_face: |
# |
Nov 18th 2019, 19:55 |
michaelze |
Just use the URL to your controller action as the form's action. Usually, that's /<controllername>/<action> where <controllername> is the under_scored version of the controller's name (e.g. shopping_carts for ShoppingCartsController. The <action> is just the name of the action function in your controller... |
# |
Nov 18th 2019, 19:51 |
johnpaul5421 |
Sorry, I just wanted to get some feedback. Using Cakephp 2.0, how can I submit form data from a view class to the controller without using the functions echo $form->create and echo $form->submit('Save'); My Action function is Add in the controller, which then will apply $this->RequestHandler->isAjax() or isPost. |
# |
Nov 18th 2019, 18:58 |
luizcmarin |
I saw that "file input, Kartik" was added to the cake4 update. Does anyone have any information on how to use it on cake? |
# |
Nov 18th 2019, 18:53 |
devito |
Has anyone ever used angular as the frontend and cake as the backend? Whats that experience like? |
# |
Nov 18th 2019, 18:48 |
ricksaccous |
oops wrong window |
# |
Nov 18th 2019, 18:48 |
ricksaccous |
y |
# |
Nov 18th 2019, 17:24 |
jotpe |
`$this->get()` seems to work. |
# |
Nov 18th 2019, 17:21 |
jotpe |
Yes, it's latest 3.x |
# |
Nov 18th 2019, 17:19 |
admad |
*I don't think |
# |
Nov 18th 2019, 17:19 |
admad |
i think view vars passed to View class ever populated it's view builder. In 4.x `View` doesn't even have a viewbuilder |
# |
Nov 18th 2019, 17:18 |
admad |
@jotpe just use $this->get() in the view |
# |
Nov 18th 2019, 17:09 |
dereuromark |
is that latest 3.x? sounds like the proper delegation is then not yet fixed in 3.x series. |
# |
Nov 18th 2019, 17:04 |
slackebot |
<jotpe> |
# |
Nov 18th 2019, 17:04 |
jotpe |
Any ideas why in my custom view I can't access my view Variables via `viewBuilder()->getVar()`? |
# |
Nov 18th 2019, 16:09 |
johnpaul5421 |
css, is there anyway to redirect this form submitted data to the control, using the Action parameter, so that when I submit the request to the control, then create a function add, $this->RequestHandler->isAjax(). Also is it possible to do this in the view form, without using echo $form->create and echo $form->submit('Save'); echo $form->end(); I just created a big form using the regular html way. |
# |
Nov 18th 2019, 15:56 |
johnpaul5421 |
Hello everyone, |
# |
Nov 18th 2019, 15:28 |
peppejaripappalardo |
Hello to everyone, i need a little help for muffin/trash for soft-delete. I have to remove a behavior on UsersTable from a custom class. Is correct to do it with this code? `TableRegistry::get('Users')->removeBehavior('Trash');` ` TableRegistry::get('Users')->addBehavior('Muffin/Trash.Trash', [` ` 'events' => ['Model.beforeFind']` ` ]);` |
# |
Nov 18th 2019, 15:28 |
neon1024 |
Then you might consider a virtual field |
# |
Nov 18th 2019, 15:23 |
lpj145 |
thanks @neon1024 but i'm not using a FormHelp, is only for API. |
# |
Nov 18th 2019, 15:11 |
neon1024 |
Worth bearing in mind, if you overwrote the error structure the form helper would not be able to automatically output the validation errors |