Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:10:01+00:00 2026-06-15T06:10:01+00:00

When baking models in CakePHP, should I add validation criteria only to the data

  • 0

When baking models in CakePHP, should I add validation criteria only to the data which are user input? Or to everything? Or to some specific data? The database consists mostly of things which will be added by admins. There’s only 1 user-related table. I’m not sure about this. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:10:01+00:00Added an answer on June 15, 2026 at 6:10 am

    Validate everything!:

    Validation to everything. There’s no reason not to add validation to everything. If an admin knows what they’re doing, and is inserting data per the requirements, they won’t see any of the validation errors anyway. But – if they have a moment of insanity, or just don’t know what’s allowed/not, then having the validation is a great fallback.

    We’ve all done it (or… NOT done it):

    It’s understandable for a small/simple project to not want to spend the time adding validation – we’ve probably all done it… but when asked “SHOULD you add validation to everything?”, I think the answer has to be “yes!”.

    Validation – not just for user-generated content:

    Validation is overall great – not just for user-entered data, but also for scraped, code-generated data, admin-entered data, and everything in between.

    Can be slightly lax… if you must

    If most of your data isn’t user-generated, you could always think about making the validation slightly more lax than it would be otherwise, but – having it is still better than not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i try baking with console .. cake bake model After choosing which table
When baking a model with CakePHP, why does it prompt for hasOne if it
I have a model object which has entities annotated with hibernate validation annotations. For
I have a Person model, which includes a property representing the data of birth
I am creating an MVVM Silverlight application and am trying to add validation to
I have the models User, Post, Comment and Tag. User creates Post. Posts can
Hey, sorry for my bad english... Using EF4 code-only, I have created some POCO
Good morning people, I am trying to create a custom baking script for cakephp.
Im trying out the banking sample application and when i try to add or
After the user fills my backing bean with info through the forms, I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.