# |
May 28th 2021, 09:20 |
slackebot |
stateless way, application rules work in stateful way, so in case of checking email uniqueness, the validation would handle checking if the email is actually valid, and the application rule checks if the email is unique. I hope I didn't confuse you more :) |
# |
May 28th 2021, 09:20 |
khalil |
@shahways to my knowledge, in the case of uniqueness, it is recommended to set the validation on both. Validation methods are meant to give back validation errors before the save process happens, it does that by checking the errors() method, however, Validation doesn't happen inside a database transaction, so you can't really guarantee if the email is still unique between validating and saving. To sum it up, validation work in |
# |
May 28th 2021, 09:19 |
narendravaghela |
It seems working |
# |
May 28th 2021, 09:09 |
narendravaghela |
It doesn't find that `disconnect()` method |
# |
May 28th 2021, 09:02 |
admad |
Did you try using the same? |
# |
May 28th 2021, 08:38 |
narendravaghela |
CakePHP 4: What is the correct way to disconnect from datasource? Earlier in 3.x version, I was used to use following to disconnect ```ConnectionManager::get('default')->disconnect();``` |
# |
May 28th 2021, 08:24 |
khalil |
Your best bet would be to create two separate "app" folders I guess, but it's hell to maintain and setup |
# |
May 28th 2021, 08:21 |
khalil |
You need namespaces for such structure |
# |
May 28th 2021, 08:20 |
khalil |
As far as I remember that's not possible with Cake 2 |
# |
May 28th 2021, 08:14 |
khalil |
@rightscoreanalysis yes it doesn't work with base64 images |
# |
May 28th 2021, 08:14 |
shahways |
So we are now wondering if we misunderstood the 2 validation layers and their purpose? |
# |
May 28th 2021, 08:13 |
shahways |
Hi all, quick check. We would like to add a uniqueness validation on our email field for Users. We noticed that when baking the model for our Users in 4.x, we ended up with two rules to ensure this validation. Once in the basic validation layer, as well as once in the application validation layer. We assumed that it would only be added as an application validation rule, based on the documentation. |
# |
May 28th 2021, 07:47 |
rightscoreanalysis |
Anyone able to help with this relatively simple routing question? https://stackoverflow.com/questions/67730899/cakephp-admin-prefixed-routing |
# |
May 28th 2021, 07:46 |
rightscoreanalysis |
Did you try Neon's Proffer plugin? |
# |
May 28th 2021, 01:45 |
khalil |
Hey guys! Is there an image upload plugin that supports ajax? like base64 images for example? |
# |
May 27th 2021, 22:30 |
rightscoreanalysis |
I actually do not thin what I am trying to do is possible looking at the cake2 source |
# |
May 27th 2021, 22:24 |
kevin.pfeifer |
well i started with cake 3, sooooo ^^ |
# |
May 27th 2021, 22:23 |
rightscoreanalysis |
be glad you no longer have to work with cake 2 :) |
# |
May 27th 2021, 22:23 |
rightscoreanalysis |
seems cake2 prefix routing meant your actons were admin_index etc in the main controller |
# |
May 27th 2021, 22:22 |
kevin.pfeifer |
then I unfortunately can't help you ,:) |
# |
May 27th 2021, 22:22 |
rightscoreanalysis |
I have this working on my cake 3 and 4 projects already |
# |
May 27th 2021, 22:22 |
kevin.pfeifer |
oh, ok ^^ |
# |
May 27th 2021, 22:22 |
rightscoreanalysis |
I am working on a legacy cake2 project |
# |
May 27th 2021, 22:22 |
rightscoreanalysis |
@kevin.pfeifer |
# |
May 27th 2021, 22:19 |
kevin.pfeifer |
see https://book.cakephp.org/4/en/development/routing.html#prefix-routing |
# |
May 27th 2021, 22:18 |
slackebot |
will be required when generating URLs for these routes $routes->fallbacks(DashedRoute::class); }); $builder->fallbacks(); } );``` |
# |
May 27th 2021, 22:18 |
kevin.pfeifer |
@rightscoreanalysis then you need something like that in your plugin ``` $routes->plugin( 'Integrations', [ 'path' => '/integrations' ], function( RouteBuilder $builder ) { // Add custom routes here $routes->prefix('Foobar', function (RouteBuilder $routes) { // All routes here will be prefixed with `/foobar`, and // have the `'prefix' => 'Foobar'` route element added that // |
# |
May 27th 2021, 22:15 |
rightscoreanalysis |
where integratinos is a plugin and foobar is a subdirectory of controllers |
# |
May 27th 2021, 22:14 |
rightscoreanalysis |
I just want to make a simple sub-directory for a group of controllers: Router::connect( '/integrations/foobar/*', ); |
# |
May 27th 2021, 21:12 |
CakeIsGreat |
$this->Events instead of $post->Events but doesn't fix anything |
# |
May 27th 2021, 21:12 |
CakeIsGreat |
Did just catch an error regarding setting $this-> |
# |
May 27th 2021, 21:08 |
CakeIsGreat |
https://pastebin.com/fB9ECn9X |
# |
May 27th 2021, 21:08 |
CakeIsGreat |
Cake isn't saving any associations. Anyone mind taking a look the controller? Can't figure this out. |
# |
May 27th 2021, 20:55 |
rightscoreanalysis |
ok looks like I can do what i need to do in the bootstrap |
# |
May 27th 2021, 20:54 |
greg138 |
`core.php` in your plugin? I didn't think that was even a thing. Isn't `core` for, well, Cake's core? |
# |
May 27th 2021, 20:50 |
rightscoreanalysis |
although now core.php is not being read :face_palm: |
# |
May 27th 2021, 20:47 |
rightscoreanalysis |
ah fixed it :) |
# |
May 27th 2021, 20:45 |
rightscoreanalysis |
I also added 'routes' => true |
# |
May 27th 2021, 20:44 |
rightscoreanalysis |
adding bootstrap true requires that i have a bootstrap.php in my plugin/Config dir, but the routes.php is still not being read |
# |
May 27th 2021, 20:29 |
kevin.pfeifer |
:+1: |
# |
May 27th 2021, 20:29 |
rightscoreanalysis |
that was it thanks @kevin.pfeifer |