# Feature request: multimode CRUD actions

**URL:** <https://discourse.cakephp.org/t/feature-request-multimode-crud-actions/1523>\
**Category:** Uncategorized\
**Created:** [November 12, 2016, 10:27pm UTC](https://discourse.cakephp.org/t/feature-request-multimode-crud-actions/1523 "2016-11-12T22:27:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![calzone](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/calzone/32/305_2.png) [@calzone](https://discourse.cakephp.org/u/calzone)\
**Post date:** [November 12, 2016, 10:27pm UTC](https://discourse.cakephp.org/t/feature-request-multimode-crud-actions/1523/1 "2016-11-12T22:27:43Z")

</div>

Requested:

The ability to create actions and forms that transparently handle any one of three modes: create / edit / view.

If you visit the page, and no id is passed, the form becomes a blank create form  
If you pass an id, the form is an edit form  
If the controller detects some condition (user permissions, for example, or a user flag of some kind) the page is presented not as a form but as a view entity page.

I do this kind of thin by hand, very often, but it can get painful and tedious. Especially if I used bake to scaffold my site, because bake creates three different actions and ctp files for each.

---

<div class="post-metadata">

**Author:** ![Andrej](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/andrej/32/446_2.png) [@Andrej](https://discourse.cakephp.org/u/Andrej)\
**Post date:** [November 19, 2016, 10:28am UTC](https://discourse.cakephp.org/t/feature-request-multimode-crud-actions/1523/2 "2016-11-19T10:28:08Z")

</div>

Hi calzone,

Did you consider using crud and crud-view plugins?

> **[FriendsOfCake/crud](https://github.com/FriendsOfCake/crud)**
>
> Production-grade rapid controller development with built in love for API and Search - FriendsOfCake/crud

---

<div class="post-metadata">

**Author:** ![calzone](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/calzone/32/305_2.png) [@calzone](https://discourse.cakephp.org/u/calzone)\
**Post date:** [November 23, 2016, 12:22am UTC](https://discourse.cakephp.org/t/feature-request-multimode-crud-actions/1523/3 "2016-11-23T00:22:12Z")

</div>

Thank you for the referral. That’s definitely a neat looking tool and sure to be helpful for a lot of future projects.

That aside, it doesn’t sound like it totally addresses the need I was speaking to. It basically sounds like a great way to bake a project, but my feature request is not merely about getting started, it’s about taking DRY to a whole next level.

I figure for 90% of forms out there, we are going to use the exact same form, validation, css, js, etc regardless of whether it’s a create new or edit existing. Moreover, I think for a high percentage of those forms, most dev are going to want the read-only view page to follow the same layout and format, just not with form fields.

So why reuse the same queries and layout code 3 times over when you could have one layout and controller handle all three uses cases? Then we could code andy exceptions inline and the whole thing would super-DRY.
