# |
Apr 24th 2017, 09:02 |
Neon1024 |
You can write your own Crud action class |
# |
Apr 24th 2017, 09:02 |
Neon1024 |
If you really really want to re-use some bespoke stuff |
# |
Apr 24th 2017, 09:01 |
Neon1024 |
I’ve only found a few cases where I’ve needed to |
# |
Apr 24th 2017, 09:01 |
birdy247 |
:) |
# |
Apr 24th 2017, 09:01 |
Neon1024 |
So it’s really easy to sidestep Crud entirely should you need to |
# |
Apr 24th 2017, 09:01 |
Neon1024 |
If that doesn’t work, just write your own controller method! |
# |
Apr 24th 2017, 09:01 |
Neon1024 |
Which is what it’s listeners do |
# |
Apr 24th 2017, 09:01 |
Neon1024 |
So you can hook Crud’s internal events to modify how it works |
# |
Apr 24th 2017, 09:00 |
Neon1024 |
$this->Crud->on(‘beforeFind’, function (Event $event) { $event->getSubject()->query->contain([‘Birdies’]); }); return $this->Crud->execute(); |
# |
Apr 24th 2017, 09:00 |
birdy247 |
:-S |
# |
Apr 24th 2017, 09:00 |
Neon1024 |
Oh yes you would |
# |
Apr 24th 2017, 09:00 |
Neon1024 |
No you would not |
# |
Apr 24th 2017, 08:59 |
birdy247 |
would I used an "event" |
# |
Apr 24th 2017, 08:59 |
Neon1024 |
The easiest way to think of the Crud plugin is like this to me. You have no controllers. So Cake generates a missing controller exception. Crud hijacks that and instead uses events to scaffold a controller action |
# |
Apr 24th 2017, 08:59 |
birdy247 |
or ->formatResults for example |
# |
Apr 24th 2017, 08:59 |
birdy247 |
If I wanted to add a bit more of a complex query |
# |
Apr 24th 2017, 08:59 |
birdy247 |
both :) |
# |
Apr 24th 2017, 08:59 |
Neon1024 |
-_- |
# |
Apr 24th 2017, 08:59 |
Neon1024 |
Oh it, you mean Crud? |
# |
Apr 24th 2017, 08:58 |
Neon1024 |
Thanks, it’s my new haircut |
# |
Apr 24th 2017, 08:58 |
birdy247 |
I guess I am thinking in "normal" cake way |
# |
Apr 24th 2017, 08:58 |
birdy247 |
Neon1024 it looks great |
# |
Apr 24th 2017, 08:55 |
Neon1024 |
Perhaps we need a tell for the docs and tutorials |
# |
Apr 24th 2017, 08:55 |
Neon1024 |
!crud |
# |
Apr 24th 2017, 08:54 |
theaxiom |
http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/ |
# |
Apr 24th 2017, 08:54 |
theaxiom |
http://josediazgonzalez.com/2016/12/01/creating-a-microblogging-platform/ |
# |
Apr 24th 2017, 08:54 |
theaxiom |
Yeah |
# |
Apr 24th 2017, 08:49 |
birdy247 |
Any good tutorials for the CRUD plugin? |
# |
Apr 24th 2017, 08:30 |
technofection |
Yeah got them @theaxiom and thank you ! |
# |
Apr 24th 2017, 08:30 |
theaxiom |
You can write configuration in bootstrap.php or you can load a configuration file into Configure |
# |
Apr 24th 2017, 08:30 |
theaxiom |
You want the write/read methods |
# |
Apr 24th 2017, 08:30 |
theaxiom |
@technofection yes that is the proper documentation I was referring to |
# |
Apr 24th 2017, 08:29 |
Neon1024 |
Moin Ceeram |
# |
Apr 24th 2017, 08:29 |
Neon1024 |
Missing second param! |
# |
Apr 24th 2017, 08:29 |
theaxiom |
sorry it has been a long day, but you get the idea |
# |
Apr 24th 2017, 08:29 |
ceeram |
moin |
# |
Apr 24th 2017, 08:29 |
theaxiom |
lol |
# |
Apr 24th 2017, 08:29 |
theaxiom |
wait I think I did that wrong |
# |
Apr 24th 2017, 08:29 |
technofection |
Okay, that gives me some idea on how to do this.. Thank you ! |
# |
Apr 24th 2017, 08:28 |
theaxiom |
`Configure::write(['foo' => 'bar']); |
# |
Apr 24th 2017, 08:28 |
technofection |
This one @theaxiom https://book.cakephp.org/3.0/en/development/configuration.html |