 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
MaltBlue.com: Zend Framework 2 Forms - Simple and Available Everywhere
by Chris Cornutt April 04, 2013 @ 11:29:49
Matt Setter has a new post to his site today about forms in Zend Framework 2 including a full example on how to use them to create a form for user information (first name, last name).
I think it goes without saying, forms are one of the central elements of any web-based application. They're used for everything from logging in, to searching content and managing information. Given that, they should be first-class citizens, able to be developed and reused with relative ease. [...] However, given the amount of options, configurability and flexibility required, this isn't always easy. [...] In today's post, I'm going to assume you have a basic understanding of how forms work now. [...] I'm going to show you how to create flexible, reusable forms in one module and by the power of the ServiceManager reuse them throughout your application.
He starts with the inclusion of a dependency needed for his example - the ZfcUser component (installed via Composer). He then moves on to the actual code for the form creating a reusable module, an entity class for the User and the Fieldset/Form classes for the contents of the form. He also includes the code for the controller action and the view that outputs the form itself and handles the repopulation automagically (and includes a CSRF token).
voice your opinion now!
zendframework2 form tutorial module zfcuser user
PHPWomen.org: Add values to a symfony form in between save() and serialization to the database
by Chris Cornutt October 05, 2012 @ 08:55:12
Kim Rowan has recently posted this helpful hint to the PHPWomen.org site concerning the addition of values between save/serialization in Symfony (1.4) forms.
OK, I have a Comment model and I want to relate Comment objects to several other different model types. So, I need to be able to persist Comment objects in my database that relate to the author of the comment and one of a handful of other tables, for example, a blog post or a licence record, etc.
She includes the contents of her "schema.yml" definition and the code to create and display a basic form. Inside of her "executeCreate", the form's submission is handled and a "processForm" method is called and the overridden "updateObject " is used to inject the new data (a user ID) into the submission.
voice your opinion now!
symfony form tutorial override save object inject data
Symfony Blog: Form Goodness in Symfony 2.1
by Chris Cornutt July 30, 2012 @ 13:41:26
On the Symfony blog there's a new post from Bernhard Schussek about some of the changes that have happened in the Forms component of the Symfony 2 framework (in version 2.1).
Those of you who already upgraded to Symfony 2.1 Beta probably noticed that the new version comes with many backwards compatibility breaks in the Form component. Many of you probably ask yourselves: Why? The simple answer is that the Form component is one of the most complex components in Symfony at all.
They list out some of the improvements (plus code showing then at work) for changes like:
- No more bindRequest()
- Custom field constraints
- Error mapping fu
- Collection improvements
voice your opinion now!
symfony2 form component improvement
Matthew Weier O'Phinney's Blog: ZF2 Forms in Beta5
by Chris Cornutt July 09, 2012 @ 09:34:05
In this new post to his blog, Matthew Weier O'Phinney about some of the recent updates in the latest beta (beta5) of the Zend Framework 2's "Forms" component.
Forms are a nightmare for web development. They break the concept of separation of concerns: they have a display aspect (the actual HTML form), they have a validation aspect and the two mix, as you need to display validation error messages. On top of that, the submitted data is often directly related to your domain models, causing more issues. [...] Add to this that the validation logic may be re-usable outside of a forms context, and you've got a rather complex problem.
He talks about the newly-rewritten form component along with the new InputFilter to accompany it. He includes an example of using this new component - making a User form that, based off of some annotation rules, does some validation on the property values and things like "required" and custom types. He also talks about some of the other features included in the new package like hydration, complex annotation support and tools to work with collections.
You can download this latest beta release from the packages.zendframework.com site.
voice your opinion now!
zendframework2 form component beta5 annotation tutorial
NetTuts.com: Easy Form Generation Using FuelPHP
by Chris Cornutt March 14, 2012 @ 10:05:17
On the NetTuts.com site today there's a new tutorial from Sahan Lakshitha about creating forms in FuelPHP, the PHP 5.3-centric framework.
Thanks to FuelPHP's fieldset class, working with forms couldn't be easier. With a few lines of code, you can easily generate and validate a form. Today, we're going to learn how to do just that!
He starts with guiding you through a simple install of the FuelPHP framework and configuring it to connect to a MySQL database. He shows how to set up a model, specify its properties and creating a controller to handle the user interaction. Using the definitions in the model, FuelPHP can automatically generate a form, complete with default options and some validation on the field (things like "required", "valid_url" and "max_length"). There's also code included showing how to edit current posts and listing out the complete post list.
voice your opinion now!
form generation fuelphp tutorial fieldset framework
PHPMaster.com: Form Validation with PHP
by Chris Cornutt March 12, 2012 @ 12:17:03
On PHPMaster.com today there's a new tutorial showing how to do some form validation using some basic PHP (no external libraries or tools here). This is a beginner level tutorial to help you get familiar with the concepts behind doing validation (and
In this article you'll construct and validate a simple form using HTML and PHP. The form is created using HTML and validation and processing of the form's contents is done with PHP. The goal is to teach you some basic HTML form elements and how their data is accessible to you in your PHP scripts.
They start with the form itself, a basic setup with various kinds of fields - text, select, radio and a checkbox. Both the HTML markup and the PHP to do the validation is included. They check for things like "not empty", "must select one" and optional fields. Be sure to read the comments for some good tips on filtering the form's input too.
voice your opinion now!
validation form tutorial html beginner
Web Mozarts: Symfony2 Form Architecture
by Chris Cornutt March 07, 2012 @ 11:13:31
In this new post to the Web Mozarts site, Bernhard talks about the architecture behind the current Symfony2 forms implementation and how it handles the requests your forms make.
Symfony2 features a brand-new Form component that, to my knowledge, supersedes most existing PHP form libraries in functionality and extensibility (not counting the still lacking, native JavaScript support). [...] The purpose of this post is to demonstrate that the Symfony2 Form component is perfectly suited for this requirement. Symfony2-specific functionality can be unplugged, leaving only the raw core dealing with form processing and abstraction.
The post is broken up into several different sections, each detailing a different aspect of this Forms functionality:
- It's influences from other frameworks
- Key aspects it provides
- Abstraction (reusable code)
- Extensibility
- Compositionality
- Separation of Concerns
- Model Binding
- Dynamic Behavior
Both a high-level architecture and low-level architecture are provided, showing you the internal flow behind the form handling. You can find out more about this component in the Symfony manual or peek into the code on github.
voice your opinion now!
symfony2 form architecture highlevel lowlevel component
PHPMaster.com: WordPress Plugin Development
by Chris Cornutt February 20, 2012 @ 10:50:39
On PHPMaster.com today there's a new tutorial showing how you can create a custom WordPress plugin for the popular PHP-based blogging/CMS tool.
If you've ever used WordPress to build a site quickly, chances are you've used one of the many plugins that are offered to extend the functionality of this popular blogging software. Plugins are one of the many things that make WordPress so attractive. [...] There are times, however, when you can't quite find what you need from existing plugins. This article will show you how to create your own WordPress plugins by walking you through an example to display some text using a widget in a the sidebar.
He walks you through all of the steps you'll need to create the plugin - making the main plugin file (definition) and using some of the methods available to create the functionality: update, form, widget and the constructor to set it all up.
voice your opinion now!
wordpress plugin development introduction simple text form
|
Community Events
Don't see your event here? Let us know!
|