Coder Social home page Coder Social logo

Comments (7)

deepgreen avatar deepgreen commented on August 16, 2024

The alternative to php is using yaml file that define the constraints - as per Symfony. I do see the technical advantage with your proxy class, I guess it is consistent approach using code generation, but validation can be very "fussy" and quite likely to be changed, Using yaml as the default lowers the barrier to get a site up "without php code". i.e. A whole site generated without code, including form validation! From your link above

Acme\BlogBundle\Entity\Author:
properties:
gender:
- Choice: { choices: [male, female], message: Choose a valid gender. }

from admingeneratorgeneratorbundle.

cedriclombardot avatar cedriclombardot commented on August 16, 2024

Yes i'm agree with the approch of yaml validators. thats why i've not already write code. I'm shared between extract automatically validations from model constraints (eg Unique column) -> so generate a php because can't do otherwise in cache. And lets devs write the validator yaml.

Do you know if a good men have do a generate validators command ? Could be a good alternative.

from admingeneratorgeneratorbundle.

deepgreen avatar deepgreen commented on August 16, 2024

+1 for yaml then. I believe that the first step is to clearly indicate to users how they can validate their model using existing validation constraints provided by symfony - without code change and of course coupled with html 5. i.e. Just extending the documentation as a start. This is why your generator approach is so powerful! When this recommended approach is written up this then it can be automated directly in the builders or commands. I think eventually the command approach fits better since this is decoupled from the builders and likely simpler. But can be deferred.
Put another way. In my opinion the generator should not in this early release do any more - you are generating symfony components which are very well documented, stable and extensible. Linking the generator to their documentation etc. Just a thought.

from admingeneratorgeneratorbundle.

cedriclombardot avatar cedriclombardot commented on August 16, 2024

OK so agree for all to move into roadmap 1.1 and method will be a command line to init the yaml into the folder of the bundle ?

from admingeneratorgeneratorbundle.

deepgreen avatar deepgreen commented on August 16, 2024

Sounds like a good plan.

from admingeneratorgeneratorbundle.

ioleo avatar ioleo commented on August 16, 2024

@cedriclombardot @CayetanoSoriano i think this is no longer neccessary as you can define validation constraints directly in the entity useing Annotations,

i think we should close this issue

from admingeneratorgeneratorbundle.

cedriclombardot avatar cedriclombardot commented on August 16, 2024

Yes and no for me validate an entity is not the same as validate a form. I can want to add differents constrainst depends if i'm in front or back for example

from admingeneratorgeneratorbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.