text:
Hmm several things to go through....
I'm loving the idea of glyphs being used to change up a rotation to make it easier. One thing that popped in my head was they could use the system to help keep all specs competitive in raiding content. Since one of the ideas was you could play your favorite spec in PvE content, you could use glyphs to improve play, or even 'live test' it, and see if doing a change in the glyph setup would make this spec better and more balanced with the other specs in pve raiding. If it turned out that yes, this change is good for this spec while raiding, they could hotfix it to make it baseline, and take the test glyph out. Hmm...live glyph testing...the more I think about it the more I like it.
One thing on the more complex rotations, I've seen a couple instances in beta right now where rotations are just flat out missing abilities that we've had in cataclysm. Some might think they are making them easier, but remember that we are getting a lot of new abilities on use from the new talent system. I don't mind losing a single rotation button that I have to execute perfectly in order to ease up adding up to 6 more abilities from talents. We're going to see more situational reactive moves so our rotation will be freed up more and we will be spending more time learning when during a fight we can execute the rotation to its maximum, and when we need to react with the other moves to reach spots to then again maximize rotations. Also don't be surprised to see players having to learn how to keep themselves alive more on their end than before. We will all be getting more survival tools and can't rely on healers to just heal us through something when we could have simply not pushed a button in our required perfect order and just pressed our 'you live' button.
I haven't cared too much for farming arbitrary points for gear on a main toon to give heirloom gear to a new toon. With the way the transmog system is working, wonderfully, I would rather have a different system for increasing experience gained while leveling.
1 - make the later levels of guild bonuses just increase leveling experience. (kind of lame, but something)
2 - In WotLK you could buy the cold weather flying book and send it to your other toon. Why not let us buy a specific armor type enchantment that gives us 10% increase experience on that item. Make it where you have to reach exalted with each of the new factions to be able to buy the buff for each item slot. Say, 5 factions, bonus enchantments for helm, shoulders, chest, gloves, and legs. 5 in all, 1 at each faction at exalted. It would be something to do with each faction, and there are already good ways to enhance faction rep, tabards, without going way out of my way to farm points to buy single loot items.
I don't think there is a good way to deal with the extra armor in regards to the holy paladin. Maybe since we are seeing hopeful improvements to loot with the LFR, we can all get loot, system and the valor point upgrade old gear to current relevancy system, we will see something to help with gear waste, but just don't know what.
I'm looking forward to having so many bosses in MoP. Mostly for me it is just for something to do. I'm one of those that can enjoy an interesting hard mode boss, but that has to have interesting changes. I've never been a fan of having every boss have a hard mode. That's not fresh and creative content. If you give me 14 bosses per raid tier, well holy cow, that's a lot to do! I'd be completely ok if say 4 of those were optional harder bosses to do for fun. Kind of like how bosses were skippable like Ignis, Razorscale, and wasn't Iron Council skippable? I know they werent hard mode bosses, but point is have more but skippable hard mode level bosses. But don't make it where I have to kill all of the other 10 bosses on normal and then a lacklusterly created hard mode for each of those 10 before I can fight the other 4. 10 normal main story bosses, 4 hard as hell bosses on the side for fun. Give us 14 bosses per tier, by the end of the expansion we would have 30 normal story bosses and 12 side hard mode bosses. No overlap so everything is more unique and fresh.
I feel for the player with the first question. It can be draining on you when you lose a team. I've spent a lot of time as a raid leader, an officer, and a recruiter. I've also taken breaks from the game for months at a time. Remember one thing, everyone is replaceable. That's a good thing. If someone leaves, there's always the next person you recruit that could turn out to be better than the one who left. I've seen that so many times. Back in the days of Ulduar I actually got excited every night someone left because we always downed the next progression boss that night. Haha. It was crazy. Don't think the guild is entirely on your shoulders. Spread out the responsibilities, encourage others to work with you, give players a chance to prove they can do a task they have shown interest in. Its highly unlikely youll be able to keep your roster static for the 18 month expansion season. Players will come and go, just stay focused on your goal for the night....raiding. PuG a slot if you have to for the night. Raiding and wiping is better than sitting around or calling the night.


text:
Tall Placed Floral Print Short Sleeve Shift Dress
Tall Placed Floral Print Short Sleeve Shift Dress
$49 .88
 For groovy glamour, we splashed a statement-making floral print across this unforgettably cute shift style – done in our perfectly drapey (and vintage textured) crepe fabric. Jewel neck. Short sleeves. Banded neckline. Back zip. Lined. 20 3/4" from natural waist.
Style #314385
100% Polyester
Machine Washable

subset: commoncrawl


text:
Vacation Rental Sales Manager - Coeur D'alene ID
Vortex Managers is hiring a Vacation Rental Sales Manager for the Coeur D'alene Idaho area. Fun work, great company and growing opportunity for significant income. Job is to enlist owners in our rental program, oversee guest service, maintenance, housekeeping, owner relations and local office.
Requires hands-on, take charge personality. Biggest part of job is selling owners on our services and keeping them happy.
We're a leader in vacation rentals, inns and resort management. If you are an efficient worker, good with staff and love to help people this is your job. You must live very near Coeur D'alene, be computer proficient, be professional and presentable, have reliable transportation and be highly motivated. Experience in lodging or food service management also a plus.
Learn about us at www.VortexMethod.com. Candidates must be stable with background in real estate, sales or customer service and willing to handle the detail coordination of maintenance, management or real estate. Prefer college degree but practical experience counts. Join our growing company in this full time, permanent & stable position. Highly paid commissions and perks.
Call Ron Lee at 866-925-5188 x 902 toll free, email email firstname.lastname@example.com or download application at the link above.
Call: 866-925-5188 x 902 Email: For more detail: VortexManagers.com Mention Ad #0210


text:
Ambiance Red Volumizing Dry Shampoo
Join the Conversation
LaurenWhich Color Of This Dry Shampoo Should I Use?I would love to try the Ambiance Volumizing Dry Shampoo but I dont know which one to choose. I have auburn hair. Which one would work better for me, the red or the brown?
Was this post helpful?YesNoJun 11, 2012Link to this post
Use this link to send this review via e-mail, Twitter, or to post to your blog.Close
Have a question or a tip to share?
If you'd like to hear more about how this product worked (or didn't) for people with hair like yours, take advantage of our network of experts and customers by posting a question. Or, if you've used the product and want to post a tip or advice, go for it.Post A Message


text:
<ac:macro ac:name="info"><ac:parameter ac:name="title">Proposal has been revised in-depth on 14 October 2006. Please take a look at revision 0.2 thoroughly if you have already read and commented revision 0.1</ac:parameter></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Form is a component for creating, validating and processing form data.
Zend Framework: Zend_Form Component Proposal
Proposed Component Name
Developer Notes
Simon Mundy
Ralf Eggert
0.1 - 28 August 2006: Initial proposal.
0.2 - 14 October 2006: revised proposal. (wiki revision: 16)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Form is a component for creating, validating and processing form data.
Zend_Form is a component for creating, validating and processing form data.
4. Dependencies on Other Framework Components
- Zend_Exception
- Zend_Input_Filter
- Zend_Filter (tbc)
- Zend_Validator (tbc)
5. Theory of Operation
Zend_Form provides a set of loosely coupled parts and view helpers to model, validate & filter, display, generate and process a form. The core of Zend_Form is the form model which is the only mandatory part. All other parts are optional, yet all parts work together smoothly with the form model.
Form model
With the form model the programmer will be able to model a specific form. It is an abstract class which needs to be extended to implement a specific form model. The model class provides the required functionalities to:
- add the unique id for the form
- add form fields
- set defaults for each form field
- accept values for the form fields (e.g. from raw $_POST data, a Zend_Filter_Input object or even a simple array)
- pass all form attributes, values and fields to an array
It also provides an abstract setup method which needs to be implemented in an extended form model class to add fields to the specific form.
Every form field is an object with a name property, an unset Zend_Validator property, an unset Zend_Filter object and a simple isValid() method.
Validation and Filtering
Since the validation and filtering part is optional the programmer can use his own validation method. Anyway the validation and filtering part provides the required functionalities to:
- add a Zend_Validator object with validation rules (e.g. Zend_Rule_Range) to a field of the form
- add a Zend_Filter object with filter rules (e.g. Zend_Filter_Int) to a field of the form
- add allowed keys for a selection using a Zend_Rule_IsIn validation rule
- validate the form
- get the error status of invalid form fields
Based on the added Zend_Validator objects a form renderer will get some relevant information about how to display a specific form field, e.g. to display the "maxlength" attribute for text input fields or to specify if a select takes only one or more options. Also the allowed select options will be set with validation rules (Zend_Rule_IsIn).
Extended form fields
There are a set of form field objects which extend the basic Zend_Form_Field. They do not add much more functionality to Zend_Form_Field except setting up the Zend_Validator object for the form field with a set of validation rules and setting up the Zend_Filter object with a set of filter rules.
For example the Zend_Form_Field_Text sets up the Zend_Validator object with the Zend_Rule_String validation rule. Optional it takes a range for the text field and adds a Zend_Rule_Range validation rule to the Zend_Validator. Selections which expect only one option to be selected, can be handled by Zend_Form_Field_Enum. Selections which expect none, one or more options to be selected can be handled by Zend_Form_Field_Set.
Zend_Form_Field can easily be extended by the programmer to add custom validation and filter rules.
View helpers
The view helpers are optional as well and extend the currently available view helpers by taking a form object to generate the output (e.g. XHTML) for
- text fields
- password fields
- textareas
- checkboxes
- radio buttons
- select lists
- file upload fields
All view helpers take a reference to an field of the form object to identify values and other attributes set by the form object. The view helpers also examine the attached Zend_Validator object for the output (e.g. to set the "maxlength" for text inputs). Furthermore the view helpers take a list of other attributes for displaying the form field (e.g. "class", "size", "rows", "title").
For a select list, checkboxes and radio buttons the view helper will add the keys and corresponding values to display. Enum selections can be display as single selects or radio buttons. Set selections can be displayed as multiple selects or checkboxes.
To display validation errors there is a view helper to get an array of all unmatched validation rules for a specific form field or the whole form. Based on this the appropiate errors messages can be displayed.
Note: it still needs to be discussed if the current view helpers (release 0.1.5) should be kept or overwritten.
Automatic rendering
Again the rendering module is optional, so the programmer can handle the rendering of the form in every way he wants to, for example with the view helpers mentioned above. The rendering module will provide the required functionalities to
- take further display attributes for each form field
- organize form fields into sections (fieldsets)
- generate the output code (e.g. XHTML) for a single field
- generate the output code (e.g. XHTML) for the complete form
Note: the layout of these generated forms will mostly be limited to a linear layout but can be changed with CSS.
Automatic form generation
This optional module generates a form model with all fields from a record of a table (Zend_Db_Table_Row) or from a XML data record. Also some validation rules will automatically be added when appropriate, e.g. set maxixum chars, allowed keys for selections, etc.).
The generated form class can be cached or saved and extended with additional validation and filter rules.
Form processor
This optional module accepts validated form data and processes it according to business needs (Note: Darby, please specify in more detail, what a form processor should do and how it should do it).
Form controller
This optional part extends the Zend_Controller_Action to add a set of methods to handle form building, form validation, form rendering and form processing and can be extended to build specific controllers.
6. Milestones / Tasks
- Milestone 1: Form building and form rendering with Zend_View helpers (UC 01, UC 02)
- Milestone 2: Render form completely and render form to an array (UC 03, UC 04)
- Milestone 3: Form validation and filtering with Zend_Validator and Zend_Filter (UC 05, UC 06, UC 07); NOTE: can not be completed until Zend_Validator and Zend_Filter can be used!
- Milestone 4: Automatic form generation (based on a database table or an xml file) and form processing (UC 08, UC 09)
- Milestone 5: Improve the client side of the form handling with Javascript validation, AJAX interaction and more.
- Milestone 6: Handle Xforms
7. Class Index
Form model
- Zend_Form
- Zend_Form_Exception (extends Zend_Exception)
- Zend_Form_Field
- Zend_Form_Field_Text
- Zend_Form_Field_Enum
- Zend_Form_Field_Set
- Zend_Form_Field_File
View helpers
- Zend_View_Helper_FormElement (acts as a factory to a Zend_Form_Render object)
Automatic rendering
- Zend_Form_Renderer_Abstract
- Zend_Form_Renderer_Xhtml
- Zend_Form_Renderer_Xhtml_Input
- Zend_Form_Renderer_Xhtml_Text
- Zend_Form_Renderer_Xhtml_Select
- Zend_Form_Renderer_Xhtml_Textarea
- Zend_Form_Renderer_Xhtml_Checkbox
- Zend_Form_Renderer_Xhtml_Radio
- Zend_Form_Renderer_Xhtml_Button
- Zend_Form_Renderer_Xhtml_Hidden
- Zend_Form_Renderer_Xhtml_File
- Zend_Form_Renderer_Xform
- Zend_Form_Renderer_Xhtml
Automatic form generation
- Zend_Form_Generator_Abstract
- Zend_Form_Generator_Db
- Zend_Form_Generator_Xml
Form processor
- Zend_Form_Processor
8. Use Cases
The use cases will build a simple form with the following form elements:
- 'username': an input type=text for username (minlength = 5, maxlength = 32)
- 'password': an input type=password for password (minlength = 5, maxlength = 16)
- 'email': an input type=text for email
- 'language': a single select for a language selector with an associative array ('en' => 'English', 'oz' => 'Strine', 'nz' => 'Kiwi');
- 'accept': a checkbox for site acceptance
UC 04: Use an array with all form values and fields to be used by Smarty
Usage in the smarty template:
UC 07: Handling error messages
For this use case we assume that the validation already took place and the following validation errors occured:
- username was too short
- email was invalid
- the accept checkbox was not ticked
Now $view->errors will hold the following array:
array('username' => array('range'), 'email' => array('email'), 'accept' => array('required'));
Template view:
9. Class Skeletons
Aug 28, 2006

At the first glance it looks like a QuickForm clone. Which is a very bad thing as it duplicates QF's flaws.

For starters it's mixing business logic with presentation. I, as a web devoloper, want to place form elements, titles or even sections on my own. I don't want any code to be involved in visual appearance.

As a programmer, I don't wan't to have any user frontend "strings" in the code - element names, section names, element comments, button captions all belong to the views. It's way to hard to make localized pages if you have your strings thrown throughout the code. And it would be great if validation error strings would also be placed directly in the views. I don't want to have any presentation markup in my bussiness variables! HTML is a presentation part, it doesn't belong to the controller or model parts of MVC.

The way I see it is to have a Form object in the code which will gather values and set defaults on form values. Then you may have a validator object which a programmer may choose to use. But I would rather have this FormValidator object pass a Form at constructor level. And then view helpers which will just use the Form object and/or the Validator to prepare it's elements - form xhtml, auto set constraints from validation data (ie. maxlength).

I will probably comment more when I find some time to analyze the code better. For now I have just skimmed it through.

Aug 28, 2006

I take your point, although I don't see it being too difficult to pass on the render responsibilities to the View anyway.

In the instance, though, of a dynamically generated form (for example a CMS database record) how would you propose separating the two layers without requiring too much 'double handling' from the Controller and the View? I.e. You'd need to populate your form twice (once with the field types, default values and validators, once with labels, decorators) and potentially pass along the source of the form structure to both Controller and View which IMO is a bit klunky.

Aug 29, 2006

Hi Michael,

thanks for your input so far. I hope you get some more time to analyze the proposal in depth.

Regarding the QuickForm clone argument. Since QuickForm is the "eierlegende Wollmilchsau" (German for "all-in-one device suitable for every purpose") for building forms any other form component will look more or less like a QuickForm clone at some stage.

In addition to Simons comment to pass the form object to the view for rendering you could also use the toArray() method and pass the results to your view for rendering.

Best Regards,

Aug 29, 2006

Ok, guys. I have read it thoroughly now but I'll answer your remarks first.

Simon, it's not a matter of difficulty. Why would I want anything to render the form on my behalf in the first place? As a webdesigner I would like to have a fine grained control over form element placement. Maybe I want to have address form elements placed on one line with only one label? And the rest not lined in a top-bottom manner.

But let's work on some example - GMail search:

<ac:image><ri:attachment ri:filename="gmail-search.png" /></ac:image>

( http://images.aie.pl/php/gmail-search.png )

How much work do you need to do to prepare a SIMPLE form like that? Everything you need in your business logic are the pure values and an information if these values are correct. You don't need to know anything about a form visual structure or even where the values come from. You just need to get them in order to make use of them. And the controller part shouldn't do anything besides that.

Then you have a user frontend - that's what (X)HTML is for. I don't want to model the look of the form in php! It's awkward! I would like to place any single element or the label anywhere I wish. And moreover, you don't need any element labels or any text in the controller code. What do you need a comment like 'e.g. today, Friday, Mar 26, 3/26/04' for in the php code? Nothing. Or 'Date within'?

What I would like here, is view helpers to create form elements only (form, input, textarea, password, etc). Similar to the ones that are already in the framework but with one exception - they should use values you defined in your business code, in Form objects. They should automatically set defaults, values, merged posted values, etc. So you don't have to pass them through the view attributes yourself.

And then comes a time when I want to switch places of 'Search' and 'Date within' elements (see the above image). It's a simple thing - you just switch their positions in the html. The code is unaffected since it doesn't matter where the elements are. But with a form modeled in the code, you have to change element sections and it's a lot of unnecessary work if you have to analyze the code. Not to mention it's completely unintuitive.

Now for the automatically generated form. You don't need such functionality in the main trunk of the form handling module. It's a useful thing if you want to hack a quick form for dictionary based tables. But let's face it - would you honestly create such a form for the customer? Me? No, never. But if you insist you can create another object (renderer for instance) which will take a real Form object as a parameter and quickly render your form for you. But don't make it an integrated feature, make it totally optional. I would like to avoid loading it's code with any html form.

I haven't touched the validation stuff yet but I will. Christopher Thompson's validator proposal should be taken into consideration here.

I don't know if any of you worked with xslt as a templating engine. It's a system where your view is really, and I mean really separated from the business code. And the form which will be similar to QF will just not make it there. Of course if you wish to keep the presentation data out of the php code.

Aug 29, 2006

First of all, I am happy to see that a form component has been proposed for the Zend Framework. On the other hand, I have to agree with Michael - this is a QuickForm clone, inheriting all the problems that QuickForm has.

Don't get me wrong: I'm a long-time QuickForm user and one of the authors of DB_DataObject_FormBuilder, so I've used it quite a lot and in general, I like it. But you can only get so far until things become really complicated.

1. I18N. As Michael said, you don't really want strings that are printed on screen to be defined in the backend. All output should be defined in the view component, including error messages when a rule condition is not met.

2. In a Web 2.0/AJAX/insert-buzzword-here world, you'll want to add Javascript event handlers, custom script elements etc. to your form. Again, this should always be done in the view component.

3. Form layout. It is nice to have a default renderer that can output your form with just one call to a render() method. It is tremendously useful for rapid prototyping. The ability to be able to define a form completely in the background, for example using a FormBuilder component that derives the form elements from a ORM layer, can only be weighed in gold. However, as soon as you leave the prototyping stage you'll want fine-grained control over the placement of each and every form element - this possibility must always be there!

As another reference for a good form component, please have a look at patForms:
http://trac.php-tools.net/patForms

The advantage of patForms is that it allows both ways of constructing forms: You can either define a form automatically or by hand using only the API functions (just like QuickForm), or you can just write a plain HTML form, placing a few special XML attributes into the element tags for defining, for example, rules. This HTML snippet can then be parsed (and cached for later re-use) by the form component and you can use the resulting form object to evaluate validation etc. in the backend.

It also features adaptors for various database layers so that form objects can both be constructed from database records and automatically write back their values to a database.

Aug 29, 2006

Another link to add as a reference... the QuickForm authors themselves are currently discussing the design for a successor to QuickForm here:

http://quickform.mamasam.com/wiki/

Possibly a good source for additional ideas, although I haven't seen anything on the separation of controller and view yet.

Aug 29, 2006

We're off to a good start! I agree, this has undeniably sprung from QuickForm because both Ralf and myself have been longtime users and it's always easier to start from something you know. And it can be a bit daunting to have that completely ripped away and look at the problem from another angle, but I'm confident that a better solution will arrive from doing it this way.

Martel, I haven't had any XLST experience but I do want to push to make this Zend_Form component play nicely in both the controller and the view. I also want to ensure we don't need to abstract the form-building process so heavily that we also need to rely on config files to construct them.

I guess I need some clarification on a few conceptual issues before I can look at turning the code on its head.

I can appreciate the need for more customisable forms - it's one of the reasons I am dissatisfied with QuickForm currently. And for forms that I know which fields are going to exist (and what type they are) I can imagine the proposed Zend_Form being very easy for me to convert to this layout. For example:-

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$form = Zend_Form::factory(new Zend_Form_Html(array('title' => 'myform')));
$form->addElement($form->createElement('id1', array('type' => 'text'));
$form->addElement($form->createElement('id2', array('type' => 'text'));
will go into my layout as:-
<?php echo $form->renderHeader(); ?>

Enter firstname, lastname: <?php echo $form->id1->renderElement() . ' ' . $form->id1->renderElement() ?>

<?php echo $form->createElement('id1', array('type' => 'text'))
>renderElement() ?>
<?php echo $form>renderFooter(); ?>

So I can still instantiate form elements within the view if I wish to. I could set up the form structure in the controller, add validators and perform post-processing and then add all the labels , properties and display-related info in the view if I wish to.

But how do you propose I would - for example - create a dynamic form from a CMS. A table record, similar to Markus' comment above. I still need to construct the form in some fashion within the controller for validation and processing. Why not add elements/titles there? If the controller is responsible for setting the language/locale of the site (I18N as above) then why can't it tell the form which labels/error codes to use and the view can then translate those into the appropriate multi-lingual response? How does a view know how to logically assemble a dynamic form without somehow referring to a model which, in a lot of cases, is manipulated within the controller before it even gets to the view?

I'm also not denying that there is a lot of View-based logic that needs to be kept well clear of the controller. A perfect example here is the Quickform client-side validators which produce some truly horrid javascript MULTIPLE times - I know I'd much rather use a more graceful library like Prototype or MochiKit to hook into these forms for some fancy effects and validation. See the code examples above where we can set an element's callback dynamically for both server and client-side validation - this could be achieved within the view.

What I would like is some use-cases or existing solutions that we could use to see how to practically solve some of these issues. I acknowledge that the current proposal will need to come some way to achieve Form Nirvana but - speaking for myself only - this will be a lot harder for me to visualise without some further detailed discussion and more concrete code (even pseudo-code for now).

Aug 29, 2006

I don't have much time on me at the moment so I will just throw another hint to supplement Markus' remarks. For the problem of what should go where take a a look at the XForms specification and tutorials.

To make the long story short, XForms <model> may be a good indicator of what should be placed in the business logic and the rest of the "xform", which is placed in the body, should hint what goes to the view part.

Some examples:
http://www.w3.org/TR/xforms/sliceG.html

I'll comment your post at a later time, Simon.

Aug 30, 2006

Simon, there's little sense in doing a clone of existing software. Judging from the code, I can do almost the same things with a QF as with the proposed code. If you are going to take this route, then why not help develop QF2? And why any user should choose a ZF Form module when he has a very similar code and a lot more mature to choose from?

I'm also a long time user of QF and just like you and many others I have stumbled upon QF's lack of certain features. And that's why I have so negative viewpoint when it comes to duplicating it's structure and API. I would like to see some fresh approach, which may have it's own weaknesses of course, but it may shine in the areas where there is no other good alternative.

I have been thinking about a good form framework design for a while but I never have had so much time on me to actually develop it. So I put my great hopes in your proposal. But since it's your code you will do what you want, and I may only give you some pointers if you choose to go a different way.

Now, I see it as a bunch of modules, highly independent of each other. There should be one mandatory item which is the form model itself. The rest should be totally optional:

(mandatory) Form model. It's a module where your form should be modeled. It's where you choose your field types and their defaults. This module will also get the values out of the request and initialize form objects accordingly. It does not contain any visual stuff or the validation. It's only responsibility is to prepare, hold and MAYBE modify the data.

<ac:link><ri:page ri:content-title="optional" /></ac:link> Validation. Module which takes a form and adds a validation to it's elements. May be designed as a form decorator or in any other way. But it also should be optional - programmer may choose to use his own validation with our form framework.

<ac:link><ri:page ri:content-title="optional" /></ac:link> View part / renderer. It's a part which takes a form model and renders a form out of it. It can render a whole form or only designated parts like it's single elements. It's a module which will need some additional strings to be defined IN IT to render the whole form for you. It can also use the validators to render appropriate errors.

<ac:link><ri:page ri:content-title="optional" /></ac:link> Generators. It's a module which tries to create a form model out of some alien data, like from a table record.

And now we come to the flow of the form.

First flow:

0. User accesses a page.

1. Form gets generated and is initialized with defaults. You don't need any validation in that part, because the user may be shown a form which will be processed in another controller (think search or login box visible on every page).

2. Form view gets generated with a help of View module.

Second flow (after user fills data and submits):

1. Form gets generated again but the same model may be used as it very generic. Form gets initialized with request data and defaults if there's a need for it.

2a. Form gets validated with appropriate validator module. If it is validated correctly view module is never used.

2b. Form gets validated and is not passed.

3b. Form view gets generated with a help of View module.

As you can see validation and view may be not used at all! So there is no sense in loading it's code on every form access. The same goes with form generation module which will be used with a first step if necessary.

The thing that needs some thinking is this - do we need to initialize all the select boxes and radio buttons before the validation? It's a thing I would like to avoid if the values are hard to get (ldap, soap, etc). You can of course cache them. Should a caching form be taken into the consideration?

Of course this is still too generic but I hope it will at least make you think of something you two have not though of yet.

And an "easier to gather" version of the XForms tutorials:
http://www.w3.org/MarkUp/Forms/2003/xforms-for-html-authors.html

Aug 31, 2006

Hi Michael, Simon and Markus,

I read through your comments thoroughly, examined the links you provided and thought through your ideas in-depth now (wow! five "th" in one thentence) <ac:emoticon ac:name="wink" />

I tried to summarize all of this in a bit of code to see if I really understood what you want Zend_Form to work like. And I also tried to keep Xforms in my mind for this.

First of all I examined for HTML forms which elements exists and what attributes they take. Then I divided them into attributes which should be set by the controller and attributes which should be set by the view. Based on this overview I figured out what Zend_Form element types we would need (please see attached file form_elements.pdf).

For example in the controller you define a text field. In the view then you can decide if it should be displayed as a single row text field <input type="text">, as a multi row text field <textarea> or a password text field <input type="password">.

The same applies for the selection field. You define a selection in your controller and in the view you can decide to build a radio button or a single select for a selection, that only accepts one value, or to build a checkbox or a multiple select for a selection, that accepts zero, one or many values.

Te same applies also for the buttons. In the controller you only define a submit button and in the view you can choose if it should be display as a normal button or an image button.

To illustrate all this with a bit of code I attached the file Zend_Form_Reloaded.zip with a sample controller and some sample view scripts. The controller handles the building and validation of the form. The sample script show some ways to display a form.

This new approach might look quite complicated at the first glance. But it is very flexible. If you want to set all attributes for your form elements in your controller you can do it. But you can overwrite the attributes in the view or add attributes which should rather be set in the view if you like, e.g. to set localization values or to add CSS to your form elements. You could even render the whole form into an array and pass that to Smarty or any other template engine you like, if you want to do it that way. Or you can organize your elements into fieldsets in your view script.

It will also be very easy to use a Zend_Config object to build the form and add further design attributes. Or we can use a form builder based on a Zend_Db_Table object to render form completely out of the box.

What do you all think about this approach? I am looking forward to discuss this.

Best Regards,

Aug 31, 2006

Ralf -

Great work! I love the flexability and the separation between view and business logic.

One question, what's the purpose of the "showAction"?

Two suggestions, we may want add two methods "setDefaults()" and "addElements()" to the FormController. See below for example. My reasoning is that "setDefaults" or "addElements" would be good methods to override for forms that extend this base form controller.

<?php

protected var $form;

protected function setDefaults()

{

$defaults = array(...);

$this->form->setDefault($defaults);

}

protected function addElements()

{

$this->form->addElement(...);

...

}

public function buildAction()

{

$this->form = Zend_Form::factory(...);

 $this->addElements();

 $this->setDefaults();

 ...

Aug 31, 2006

Hi Dale,

I am not quite sure, if I understood what you mean with your suggestion. But the FormController should not really be a part of the Zend_Form component. I just created it in my example code for illustration purposes. Though, it is possible to create your own FormController if you like.

Regarding your question abaout "showAction". I also added that method only to demonstrate the possible flow of form building, form processing and presenting the results when validation was successful.

Best Regards,

Sep 01, 2006

Ralf, no, it's still too close to QF's model. You just have moved some business logic out of the controller to the views. I won't go into discussing if this is something which shouldn't be done in MVC, but please have in mind views should only display model data. I would avoid creating objects there - be it Smarty or Form View models. And the stuff happening in the layoutform1.php should be in fact handled by appriopriate view helpers (or helper like object passed to the view). It's a fine example otherwise, a bit closer to being right. But it's design is still coupled to tight for my tastes.

Now, couple of ideas. I haven't thought them thoroughly, so I don't really know if it's possible to achieve them with a lightweight approach. But anyway.

In the controller code you don't need any information concerning field types, right? Everything you need it to know from the code's standpoint is a variable name in order to get the value out of the REQUEST data. So, why bother setting a type there? In fact you only may need a type of a variable, since you get strings and arrays from forms. But not necessarily. Well, as I have mentioned before - form business model is only holder for named values. You probably don't need anything else there.

To create a form in visual manner, you need to know what type of form you are going to create - html standard form, xform, etc. But this is form designers choice. Give them helpers to create html they like - $this->formTextarea(), $this->xformSecret(), etc. But it should be as painless as possible so by feeding it a name it should automatically get the value (default or already posted info) from the above form model. In XForm though you probably should have something like $this->xformModel() to populate the head with those values instead. These view helper should also use Form Validation data to set appropriate attributes - ie. maxlength.

The Zend_Controller_Action_Form as a base object to extend your controllers from may be another good idea. This way you can control the flow of the form on behalf of the programmer - testing if the form is new, reposted, validating when necessary, etc.

But I have to admit something. I have rather vague picture of the form framework in my head. It's hard for me to explain it properly and it's for sure even harder for you to see it. So if you're going to just modify current structure then I would advise to just ignore my insights. Don't try to satisfy everybody because you will end up with a bloated code no one will ever use.

Sep 01, 2006

Hi Martel

I think 'too close to QFs model' may be getting in the way of solving some difficult issues. QF wouldn't have been adopted so widely if it wasn't successful at answering some baseline requirements. Yes - it's flawed and it's slow, but it's also pretty good at what it does.

One area that still has me confused in your responses is how validation is handled in your ideal form. I agree about making the form lightweight in the controller - you don't want to pollute it with display info if it's not required. But assigning field types to the form is more than simply describing how it looks - it affects validation. E.g.

A text field is different from a textarea in that line breaks are not possible.

It's impossible to tell that a select should only return 1 value or an array of values if you haven't specified if it's a multiple select or not.

If you haven't populated a select option list before validation, how do you know if the submitted data was actually a selectable option?

How can you validate a file upload if you're not taking the $_FILE superglobal into the picture (which you wouldn't if you didn't allow for a file input when inspecting the form values)

A disabled form element shouldn't have its value set in the submitted data

And even above this, how can we trust that the data supplied to us matches the original source? Through misadventure or malicious intent, form data can be forged or injected and without some idea of what we're validating against then it's more than likely we provide ineffective validation and we open up a form component to abuse.

It could be argued that we could add more validation filters to reduce this dependency on the field types, but I think ultimately heading down that direction would be enforcing a bad answer onto a flawed question. After all we still want to make this form both easy to use and safe to use out-of-the-box.

All that said, I fully agree that we need to find the ideal blend of speed and code efficiency to reduce the amount of effort invested in simply creating/validating a form. I knew this one would be a tough one to crack as inevitably there will be a vast difference of implementation needs.

Thanks for the updates Ralf - will respond to the new Form Controller idea as soon as possible

Sep 04, 2006

As I have said before, you validate the data that comes thru HTTP. As optional validators probably (see Christopher's proposal). You don't need to know where the data comes from - textarea or text. You only need to specify if the incoming data can contain spaces or not.

When it comes to array or single value, again, it's not important. Validators will halt the execution when data is in a wrong format for your needs. As you said before - form is easily spoofed, so it really doesn't matter what kind of element you will present to legitimate user.

To answer the question of prepopulating selects - the thing one is sure about is to get the data once - you will have it in an array, in key and value pairs. And the array will be used twice - in the appriopriate validator which will have to know what values are available and in the view while creating form element. You can bind them by hand or, as I have said in earlier posts, make the view module use validation data to prepopolate it's own structures.

And now a file. You don't specify a type in incoming data. File does not come as a POST or GET data so you have to treat it specifically from the start. It's something that can't be treated as a normal data and QuickForm also treats it differently.

Now a disabled element. Just as with XForms - if you don't need a value, then you don't create the structure in the base form object. But you can freely place as many view elements as you like. It just won't take their values into consideration.

"And even above this, how can we trust that the data supplied to us matches the original source?"

By the use of validation module. And you're never sure if it comes from your form or a modified one. Or even from a hand crafted request maybe. But it also doesn't matter - in php business logic you're interested in the data that is coming to you. And not it's source.

What I am proposing is taking a XForms path, where you clearly separate the presentation from the data. It's totally different approach since QF and your solution relies on defining HTML Form structure in php and my solution centers around incoming data. And that's why I honestly want to discourage you from trying to incorporate those ideas to the current implementation. It's like rowing up the river.

Sep 04, 2006

I'll run with your thought process through a semi-typical form example. Sometimes it helps me to get more clarity if I can work with something tangible.

I need a form to capture a username, password, an email address, a language selection and acceptance of site terms and conditions. Traditionally, I would use the following:-

An input type=text for username (maxlength = 32)

An input type=password for password (maxlength = 16)

An input type=text for email

A single select for a language selector with an associative array ('en' => 'English', 'oz' => 'Strine', 'nz' => 'Kiwi');

A checkbox for site acceptance

If we approach this they way you're suggesting (and I'll use pseudo-code or non-existent classes purely to illustrate some concepts) I thought it may pay to make the form more of a model itself.

Then it may look something like this:-

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$form = new My_Form('myformid');
if ($form->validate()) {
$value = $form->getValues();
$view->form = $form;
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
abstract class Zend_Form implements Countable, Iteratable
protected $_field;
protected $_error = array();
protected $_default = array();
protected $_values = array();
final public function accept($values)Unknown macro: { $this->_submit = $values; }
final public function validate()
if (!count($this->_getSubmitValues()))Unknown macro: { return false; }
return $this->_validate();
public function getValues()Unknown macro: { return $this->_values; }
abstract protected function _setup();
protected function _validate()
foreach($this->_field as $field) {
if (!$field->isValid())Unknown macro: { $this->setError($field->getId(), $field->getValidationError()); }
if ($this->hasError())
return true;
class My_Form extends Zend_Form
protected $_defaults = array('lang' => 'oz');
protected function _setup()Unknown macro: { $this->addField('username')->addValidator(new Validator_Required()) ->addValidator(new Validator_IsType('string')) ->addValidator(new Validator_Range(5, 16)) ->addValidator(new Validator_Regex('/^w+$/')); $this->addField('password')->addValidator(new Validator_Required()) ->addValidator(new Validator_IsType('string')) ->addValidator(new Validator_Range(5, 16)) ->addValidator(new Validator_Regex('/^w+$/')); $this->addField('email') ->addValidator(new Validator_Email()) ->addValidator(new Validator_IsType('string')); $this->addField('lang') ->addValidator(new Validator_Required()) ->addValidator(new Validator_IsType('string')) ->addValidator(new Validator_IsIn($options)); $this->addField('accept') ->addValidator(new Validator_Exists()); $this->addFilter(new Filter_Trim()); // Works on all fields - default? $this->addFilter(new Filter_Striplines()); }

Finally we have the view for the form. I won't get into JavaScript validation for now - that will come once this first hurdle has been passed.

Here's the hand-crafted way (using the existing Zend_View_Helpers)

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[

Enter user details

<form id="<?php echo $form->getId() ?>" method="post" action="<?php echo $form->getActionPath() ?>">

Username
<?php echo $this->formText('username', $form->username->getValue(), array('size' => 32)) ?>

Password
<?php echo $this->formText('password', $form->password->getValue(), array('size' => 32)) ?>

Email
<?php echo $this->formText('email', $form->email->getValue(), array('size' => 32)) ?>

Language
<?php echo $this->formSelect('lang', $form->lang->getValue(), null, $form->lang->getOptions()) ?>

Accept the terms?
<?php echo $this->formCheckbox('username', $form->accept->getValue()) ?>

<?php echo $this->formSubmit(null, 'Enter') ?>

It feels more like a Zend_Db instance for me this way - which isn't a bad thing - and I do like the consistency of approach. I do still have doubts that we are still needing a lot of work to validate data when a lot of manual the validators/filters would be removed if we could use 'hinting' to achieve this within the form class itself (e.g. the select IsIn validator, or the IsType('string')). BTW, the IsType is useful to ensure some bunny hasn't tried to inject an array where you expect a string or vice-versa.

Martel - am I closer to understanding you here?

Sep 05, 2006

As I have mentioned in a private mail, Simon, I don't have much time on me so I will make it very brief. Hope you will get the idea from the abstract code and it's scarce comments. The code itself was just created in 10 minutes, I don't have any working parts of this system. It's just a draft that will hopefully help understanding my previous rants.

The only thing that is not covered is the passing of error strings to the views. The easiest way would be to provide a third parameter to addValidator but it will leave some view data in the business code. I have yet to think how one can put the strings directly in the views.

There are also places where I'm not sure how things should be done properly - like how to pass $languages to form view elements.It needs some research.

The objects are very loosely coupled. You don't need to use anything but first Form object. You can prepare your own html form by hand, you don't need to use validators, you don't need to use form controller, you aren't forced to use generators. And what's most important - you can easily use your own objects in place of the original ones.

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$languages = array ('en' => 'English', 'oz' => 'Strine', 'nz' => 'Kiwi');
// Form model
$form = Form($_POST);
$form->addDataSource('language', $default = 'en');
$form->addDataSource('accept', $default = 0);
echo $form->getValue('email');
$form->hasData(); // bool - true if submitted
// Validators
// - for a html form you will use:
$validator = Form_Validator($form);
$validator->addValidator('username', new Validator_Required());
$validator->addValidator('username', new Validator_IsType('string'));
$validator->addValidator('username', new Validator_Length(5, 16));
$validator->addValidator('username', new Validator_Regex('/^\w+$/'));
$validator->addValidator('language', new Validator_Enum(array_keys($languages)));
// - for a xform:
$validator = XForm_Validator($form, $xmlschema = '/path/to/schema'); // string or even DOM object
$validator->hasError('username'); // bool
// Generator
// - just an idea from the top of the head. I generaly hate such generic generators
$gen = Form_Generator_TableRow($form, Zend_Db_Table_Row $row, $prefill = true);
$gen->setElementID('username', 'fe_102');
$gen->render(); // prints whole form, QF renderers like.
// Form View
$view->form = new Form_View($form, $validator);
// we may set it here but I'm not sure if it's the best approach
// maybe passing it to view would be better. I don't know
$view->form->setData('language', $languages);
// Zend FW Views
$this->form->renderText('username', array('class' => 'fe_username'));
$this->form->renderSelect('language'); // will use default from Form, display data from Form_View
// Zend FW Controller
// example idea of a form controller with strict method naming
// In createForm() you create Form object and return it
// In show() you create appropriate View object (generator or plain) and pass it to the view
// In execute() you, well, execute your businness logic - ie. saving new user to the database
class Zend_Controller_Form extends Zend_Controller_Action {
abstract protected function createForm();
abstract protected function show($form, $validator = null);
abstract protected function execute($form);
protected function createValidator()Unknown macro: { return null; }
public function indexAction() {
$form = $this->createForm();
$validator = $this->createValidator();
if (!$form->hasData())Unknown macro: { $this->show($form); return true; }
if (isset($validator) && !$validator->validate())Unknown macro: { $this->show($form, $validator); return true; }
return true;
Sep 05, 2006

I like the concept.

"The only thing that is not covered is the passing of error strings to the views."

Could we have all the error strings in the view and use the method "$this->form->hasError('username');" to choose to display or not display the string?

"There are also places where I'm not sure how things should be done properly - like how to pass $languages to form view elements.It needs some research."

Since the validator knows the "keys", could we create the "values" for the select in the view? Also, we should consider incorporating, or have a way to incorporate, the I18N work to display select values in other languages?

Sep 07, 2006

Yes, the idea is to keep error strings in the views, but the problem is that every field can have many error reports. So you have to get access to the info on which validator has failed the test somehow.

And for the values in views - you have to know both there, the keys and the data, to create a select field.

A for the I18N - that's one of the main reasons why we want to keep all the frontend strings in the views.

Sep 07, 2006

What if the validator had its own view template? If the validator failed during the validation step in the controller, then it would pull its message from a view template and add it to a form message array sent back to the form view.

"And for the values in views - you have to know both there, the keys and the data, to create a select field."

The "values" of a select are only important to the view. The controller, validator, and form don't care what "value" you selected, they only care about the "key". So, why not use the view to set up the association between key and value? The view can get the keys from the validator and through some means, generate the association. Default could be value=key.

Sep 06, 2006

Michael -

What's the purpose of splitting the form and validator up? Why not attach validators to form elements?

Sep 07, 2006

Well, a couple of reasons. For starters you can use your own validation methods if you wish to. Next thing is the validation may be very different for different kind of forms - ie. in XForms the form only needs to make one check against corresponding XML Schema (you don't define rules in PHP). And you may choose not to use validation at all in which case you don't have to load it's code.

Sep 01, 2006

BTW, is it possible to get Dale's response edited to remove the long lines that are causing horizontal scrolling?

Sep 01, 2006

Original comment posted by Dale M. at Aug 31, 2006 09:32:

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
protected var $form;
protected function setDefaults()
$defaults = array(...);
protected function addElements()
// ...
public function buildAction()
$this->form = Zend_Form::factory(...);
$this->addElements(); $this->setDefaults();
// ...
Oct 18, 2006

My comment concerns UC7: Error Handling.

I don't like the error strings in a message array. I think it works if you're only working in 1 language but when you start to add new locals this will break down (IMO). I think the validator should have an associated view template, that can be overridden in the configuration parms. When an error occurs, this view template will be executed to present the error message. The only additional information that the validator would need to properly present the error message would be the "caption/label" for that field.

For example:

(required validator template)

'
' is a required field.

(range validator template)

'
' must be between <min> and <max>.

Oct 18, 2006

Hi Dale

Currently the validator is being revised so that it returns terse messages ready for translation (e.g. is_required, is_email, is_regex etc...). Of course you can override these values with whatever you choose as it's ultimately up to you how you want to transform these messages. The example above shows one scenario, but one you describe could be handled like so:-

<ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[
Your controller
$form = new MyForm;
$form->add('myfield')->addValidator(new Zend_Form_Validator_Required('rule_01'));
$renderer = new Zend_Form_Renderer_Xhtml($form);
$view->form = $renderer;
Your view

<?php echo $this->myTranslate($this->form->myfield->getError()) ?>

So you would pass off all translation responsibility to another view plugin. Or perhaps you could even pre-process all the translation strings with a model before it even hits the view? Ultimately it's left up to the developer to handle these problems. We'll be following the progress of Zend_Translate to see how that or similar components could potentially be integrated as a renderer pre-processor.

Oct 19, 2006

I would like to see the abstract classes Zend_Form_Generator_Abstract and Zend_Form_Renderer_Abstract be renamed to Zend_Form_Generator and Zend_Form_Renderer respectively. The "_Abstract" portion of the class name is redundant as the classes are already declared so using the PHP abstract keyword.

Oct 19, 2006

The framework as a whole should be consistent. Either all abstract classes are named Zend_XXX_Abstract or none of them are. In this proposal, there is a mix which is confusing.

Oct 19, 2006

I'm personally happier to use the explicit 'Abstract' suffix as it makes code more readable and, as Rob suggests, more consistent across the framework. We'll be cleaning up the structure as we go, but we're still in the middle of reorganising the structure so have not yet had the opportunity to update the proposal skeleton. Shan't be too far away, though!

Nov 25, 2006
<ac:macro ac:name="unmigrated-wiki-markup"><ac:plain-text-body><![CDATA[I really agree with every thing that has been said by Michael Minicki (Martel).
So my $0.2
Form business model is only holder for field name values and we should have something like Zend_Form_To (Transfer Object or Token ) for that purpose.
Zend_Form shoud only deal with form business and not validation witch is part of form logic flow. It could receive as a parameter a instance of Zend_Form_To to populate an auto generated form for example.
Form Logic flow should be handled by a Form_Controller or Transaction_Controller (see here for example of php4 Transaction Engine http://www.interaktonline.com/Documentation/MXKollection/060000_tng3_core.htm)
I did a dirty prototype with a Zend_Form_To and a Zend_Transaction here is example of what came up with :
Example base on a Use case where a user is updating his user profile. The other neat thing about Transaction_Controller is that it make thing easier for code reuse, a insert transaction could share most of the call back function. Note I have put the callback function at the bottom for better readability.
public function editAction()
// validator
$validator = new Zend_Validator();
// Form transfer object (holder for named values)
$form = new Mmx_Form_To;
// errors message
$errors = '';
// create a new transaction
$transaction = new Zend_Transaction;
// the transaction will start on form submit
$transaction->registerTrigger('STARTER', 'DEFAULT', isset($_POST['add']));
// If the transaction doesn't start the INIT triggers are execute
// here we init form data
$transaction->registerTrigger('INIT', 'triggerSetupForm', $form, $this->_getParam('id_pst'));
// The transaction did start all the triggers are executed in the right order
// validate form data
$transaction->registerTrigger('BEFORE','triggerValidate', $validator);
// Save data to the database inside the main transaction
$transaction->registerTransaction('transactionSave', $form);
// Save the picture to the file system
$transaction->registerTrigger('AFTER','triggerSavePicture', $form);
// Send a email to admin
$transaction->registerTrigger('AFTER','triggerSendNotification', $form);
// All transaction have been executed without errors
// Redirect to a other page
tryUnknown macro: { $transaction->execute(); }
// If one of the trigger throw a exception the transaction is stopped
// we could implement some rollback technique to discard database change
// the form is redisplay with a error message
catch(Zend_TransactionException $ex)Unknown macro: { $errors = $ex->getMessage(); }
// Pass form data to the view
$view->form = $form;
// Pass validator to the view for display field errors if any
// and to view helper to handle client side validation with javascript
$view->validator = $validator;
// Main error message
$view->errors = $errors;
echo $view->render('FormView.php');
// Triggers
function triggerSetupForm($form, $id)Unknown macro: { $profile = new UserProfile(); $data = $profile->find($id)->toArray(); $form->populate($data); }
function triggerValidate($form)
$isnullrule = new Zend_IsNull();
$validator->addRule('name', $isnullrule, 'please enter your name');
$validator->addRule('surname', $isnullrule, 'please enter your surname');
$validator->addRule('email', $isnullrule, 'please enter an email address');
$validator->addRule('email', new Zend_Rule_Email(), 'not a valid email address');
$validator->addRule('age', new Zend_Rule_Range(1, 150), 'number not in range 1-150');
if (!$validator->isValid($form))Unknown macro: { throw new Zend_TransactionException('Errors in you form'); }
function transactionSave($form)Unknown macro: { $profile = new UserProfile(); $profile->save($form->toArray()); }
function triggerSavePictureUnknown macro: { // save picture here // We throw a exeption if we can't save the picture // then the save to database shoud be rool back ! }
function triggerSendNotificationUnknown macro: { $mail = new Zend_Mail(); $mail->setBodyText('This is the text of the mail.'); $mail->setFrom('email@example.com', 'Some Sender'); $mail->addTo('email@example.com', 'Some Recipient'); $mail->setSubject('TestSubject'); $mail->send(); }
function triggerRedirect()Unknown macro: { header("Location}
// End Triggers
}Unknown macro: {/CODE}
Nov 25, 2006

Ahhhhhhh ! How can I correct my comment? Sorry for this bad presentation.

Feb 14, 2007

I agree to separate form model datas and view presentation...

With the logic of Zend framework you can do also this use case:

$id = $this->_getParam('id');

$fpost = Zend::registry('fPost');

$datas = array();

$datas['name'] = $fpost->getRaw('name');

$datas['email'] = $fpost->isEmail('email')

Feb 14, 2007

Sorry, I have made an error validation and I can't rectify...

I agree to separate form model datas and view presentation...

With the logic of Zend framework you can do also this use case:

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
public function selectAction()
Unknown macro: { $id = $this->_getParam('id'); $this->view->formdatas = $this->productTable->find($id)->toArray(); echo $this->view->render('form.php'); }
public function updateAction(){
$fpost = Zend::registry('fPost');
$row = $this->table->find($this->_getParam('id'));
$datas = array();
tryUnknown macro: { if(FALSE === $fpost->isemail('email')) throw new Zend_Exception('invalid mail') ; $datas['email'] = $fpost->getRaw('email'); $datas['name'] = $fpost->getRaw('name'); $row->setFromArray ($datas); $row->save(); }
catch (Zend_Exception $e)Unknown macro: { $this->view->error = $e->getMessage(); }
Feb 23, 2007

in a nutshell, my opinion is that there should be both a "basic" and "advanced" approach to creating forms.

Zend_Form_Basic:

This would be more or less be a QuickForm clone. I don't think there is anything necessarily wrong with a QuickForm clone since it can handle many of the common cases. Sure, it might be more tightly coupled with the the view/renderer/blah but this is about automating the creation of forms and minimizing any design effort.

Goal: be easy to use, automate creating forms

Zend_Form_Advanced:

If you want a more fine-grained approach for how to lay out the form (more designer/flexible/friendly). You would get something like Simon Mundy's describes in his post on Aug 29, 2006 06:14 or something similar to Ralf's post on Aug 31,2006 05:48.

Goal: offer the flexibility that would be needed for more clear separation and flexibility

I believe having two separate components for both basic and advanced usage will satisfy the different needs that would be required for a typical web developer. I'm skeptical if any kind of real middle ground can be reached for handling forms.

May 31, 2007

I think there should be clear separation between behavioural aspect of the form and its elements - such as validation, state, etc. and visual representation of the form elements. To the point that I could use form mechanism for form validation, while drawing my form by other means - such as pure HTML or template or any other. There should be also mechanism for each element to execute its validator and if there's a problem to know what's wrong with it. There should be also possibility to somehow define rules for more than one element (maybe just define callbacks to be called on validation). This would be one layer.

On top of this layer we may have other (optional) layers which would provide means to display form elements, to manage their lifecycle (e.g. remember data between calls) and to link them to the MVC infrastructure if needed.

Also we might want to consider supporting some security measures against XSRF replay attacks - i.e. generating some secret value for the form when displayed, storing it in the session and then checking it when submitted, so that if somebody else submits the same form it would not work.

Jun 01, 2007

I'm from the opinion that it is possible to make a cake and eat it too.

Contains business logic and everything related to data

Manages form data between submissions via handlers (serializing / db writes / etc.)

Allows for submission tracking

guarding against multiple submits possible

XSRF replay attacks prevented

no cookie or special end-user means of tracking necessary (form session may be tied to PHP session)

Zend_Form presentation classes to extend Zend_Form

Zend_Form_AJAX (may extend Zend_Form_XHTML?)

Zend_Form_Paged (multiple pages)

Zend_Form_Tabbed (multiple tabs on same page using AJAX)

Therefore, if you like a business model for handling form but not actually rendering a form, Zend_Form and Zend_Form_Session are for you.

 However, if you're like me, you may appreciate the ability to render a form (or parts of it) using the respective presentation classe above.

Sep 05, 2007

I would go this way too. One simple solution could be like this :

Zend_Form is just containing data between request.

Validation and filtering is delegated (proxy?) to a Zend_Input_Filter instance

Validation rules are pass to Zend_Form as an array (as specified in the Zend_Filter_Input documentation). This array could be reuse on the view to generate client side validation.

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$form = new Zend_Form();
// set filters and validations rules
$form->setValidationRules(null, $validators);
// failed
if ($form->hasInvalid() || $form->hasMissing()) {
$this->view->errors = $form->getMessages();
// succeed
else {
// handle data

In the view part you can use plain xhtm or zend form view helpers and retrieve data from Zend_Fom

Use Zend_Form_Xhtml (or Zend_Form_Render_Xhtml ) solution which could render the form elements, errors and hits.

Jul 30, 2007

Based on this proposal and a discussion at #zftalk a few weeks back I started my own implementation of Zend_Form.

Today I placed it on a SVN server so everyone can have a look and provide me with much needed comments.

URL: http://tools.assembla.com/svn/zfcomponents/

Please beware that I'm working on the component at the moment of this writing, so it may be possible there are some unexpected bugs. The examples that are provided also need some hacking at this moment to get them to work (bad naming in the examples). Will fix that ASAP <ac:emoticon ac:name="smile" />

Sep 05, 2007

Your solution could be simplified by delegation all the validation and filtering stuff to a Zend_Input_Filter instance. Validation rules are pass to Zend_Form as an array, as specified in the Zend_Filter_Input documentation or directly with a Zend_Filter_Input instance.

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$form = new Zend_Form();
// set filters and validations rules
$form->setValidationRules(null, $validators);
// failed
if ($form->hasInvalid() || $form->hasMissing()) {
$this->view->errors = $form->getMessages();
// succeed
else {
// handle data
Sep 05, 2007

Sorry this comment was intend to Mitchell Hashimoto Zend_Form proposal...

There is too many of them <ac:emoticon ac:name="smile" />


text:
|Product Catalog > Retail Catalog > Kick > Pellet Filled Footbag/Netbag Line-Up > Footbags & Netbags $11 - $20 > "Legend" Pellet-Filled Footbag
Customer Reviews:
This footbag soars. Give it one small kick and it's up in the air. It's pretty awesome and has a unique feel. -- Max
A one of a kind legend!
This footbag maintains all the excellent characteristics of my othe favorites the juice and the dream, but has a unique design that is really a joy to look at while it's in the air. -- Kirkuleez


text: 1 BLANDSYounger | 12/10/2007 | See all SYounger's reviews (15)Extremly bland uninspiring songs, instantly annoying. A band who appeal to a mass of teenagers and those in their early 20's who are trying to re-live the 70's instead of embracing modern times and music. This is re-hashed 70's music as is most of this 'indie' genre. Please somebody do something innovative and not rehashed?


text: I have been to Caravan before and the food (if you get blessed to get a chance to even order) is tasty and fresh. As a New Zealander, one of the few things I miss from home is a good brunch cafe. Caravan does good coffee and has a good feel to it. Usually. Today my experience was upsetting. Today I took a fellow kiwi friend there for a special 'last breakfast in London' meal. Knowing Caravan is popular I knew we may have to wait. That's okay. Sometimes you have to wait. But and hour and a half? Seriously? Waiting in the cold we saw a few people just give up and leave. One girl was very polite and expressed she had waited for an hour and a half but now had to go. She was upset as she had watched so many come after her and get seated before her. We waited like chumps outside in the freezing, ignored completely by staff for an hour and then asked the waitress when we could get a table (for three) she said we were next on the list. Half an hour later and several people leaving and more groups being seated, we realised that whatever seating system they had, our table of three was well at the end of any priority. I will now never go back. They lost at least £70 (be aware they are not a cheap place to eat). Should you experience similar, please don't wait an hour and a half, jump on a 19 bus towards Finsbury park (bus stop across the road). Get off on Blackstock road at the Riversdale road stop and go to Globe where the customer service is excellent and the breakfast (around £5) is just delicious. I recommend Flat White and Milk Bar in Soho for yum coffee. It is such a shame as Caravan could have made the whole experience easier by just talking to us and being honest about the wait. Or even just talking to us AT ALL. On leaving I explained to the waiter that we had seen at least three or four groups get seated who had arrived well after us.The waiter did not apologise. Pretty stink really. I wanted to show off a good food place and left feeling like an invisible person.


text:
Super Street Fighter IV PS3 Cheats
Answer from BlueBomber88
PP=Player Points. These go up and down as you win and lose, and you don't lose as much as you gain per match, so it will gradually build up. At higher levels it's easier to lose them, though. BP are Battle Points, which measure how experienced you are wit
|no game game on
Any prequel bonuses for owning the original Street Fighter IV? Answer Question
Answer from GhostsnGlass
Yes, you get colors 11 and 12. 11 is the first color that has extra shading like in the promo videos which looks pretty cool. 12 is a weird cross thatch pattern over your character. You also keep any alternate costumes you bought before. Trophies don't ca
|no game game on


text: DIGITAL TREASURES : Search Results home : browse : advanced search : preferences : my favorites : about : help Search results for View > 1880 Refine your search SubjectPoseyville (Hopkinton,... (2)Ash Street Schoolhouse... (1)Church Street (Hopkint... (1)Commons-massachusetts-... (1)d.t Bridges & co (Hopk... (1)Show more... results 1-17 of 17 item(s) page 1 of 1 : ( << 1 >> ) :: previous : next select all : clear all : add to favorites Image: Title: Subject: Description: 1. Album image 05, Town Hall Town Hall (Hopkinton, Mass.); Historic buildings-Massachusetts-Hopkinton; Hopkinton (Mass.)-History Town Hall building on Main Street Hopkinton circa 1880. It is a four-story wooden clapboard building with steps and prominent front porch, view is east side of building. Note man sitting on porch with... 2. Album image 07, D.T. Bridges & Co.'s Boot Manufactory D.T. Bridges & Co. (Hopkinton, Mass.); Historic buildings-Massachusetts-Hopkinton; Shoe industry-Massachusetts-Hopkinton Four-story wooden shoe manufacturing building from the east side with the view behind to the west. Its first floor is constructed from brick, windows are arched. The roof has a two tier tower and a clock.... 3. Brick Bank Building at # 1 Main Street Hopkinton Historic buildings-Massachusetts-Hopkinton; Bank buildings-Massachusetts-Hopkinton; Main Street (Hopkinton, Mass.) View of north side of a brick commercial bank building at one Main Street Hopkinton, with pillars front and side. It includes adjacent and connected one story building, both are framed by wrought iron... 4. Eastman Grain Company, image #2, Hopkinton 1886 Eastman Grain Company (Hopkinton, Mass.); Hopkinton (Mass.)-History; Historic buildings-Massachusetts-Hopkinton View of Eastman Grain Company of Hopkinton ca 1886. There is a commercial clapboard barn building and on the left is a man in overalls standing behind a harnessed horse. A second man stands in the left... 5. Hayden Rowe Looking Towards Main Street, ca. 1880 Hayden Rowe Street (Hopkinton, Mass.); Hopkinton (Mass.) History; Hopkinton (Mass.) Pictorial works A view of Hayden Rowe Street in Hopkinton, ca 1880. The view is north towards Main Street, the street is unpaved and pedestrians can be seen on either side. In the right front of the image is a man standing... 6. Hayden Rowe Street, Hopkinton Massachusetts 1880 Hopkinton(Mass.)-History;Hayden Rowe Street (Hopkinton, Mass.); Historic districts-Massachusetts-Hopkinton Man standing on east side of Hayden Rowe with a view to the north. Picket fences line the houses on the right, residence on right may be # 57 Hayden Rowe Street 7. Hopkinton Schools, image 5, Ash Street Schoolhouse 1880 Ash Street Schoolhouse (Hopkinton, Mass.); Schools-Massachusetts-Hopkinton; Ash Street, (Hopkinton, Mass.) Three-story wooden schoolhouse located on the corner of Ash and Main Streets Hopkinton Ma. ca 1880. It is a clapboard building with 2 chimneys and a circular window in the front on the third floor, this... 8. Main Street Hopkinton near Cedar Street intersection Hopkinton(Mass.)-History; Main Street (Hopkinton, Mass.); Historic districts-Massachusetts-Hopkinton West Main Street, Hopkinton, with view to the west. Pedestrians are congregated on the right, view includes residential and commercial buildings and picket fencing. 9. Man and dog on Hopkinton Town Common Commons-Massachusetts-Hopkinton; Main Street (Hopkinton, Mass.); Church buildings-Massachusetts-Hopkinton Outline of a a man with a dog on Hopkinton Town Common pathway. ca. 1880. In rear are Main Street with original Congregational Church, Highland House Hotel and other buildings. View is facing north west.... 10. Poseyville looking east, Hopkinton, ca 1880 Poseyville (Hopkinton, Mass.); Wood Street (Hopkinton, Mass.); Woodville (Hopkinton, Mass.); Hopkinton (Mass.)-History Image from photographic postcard ca 1880's showing 'Poseyville,' a portion of Wood Street in the Woodville section of Hopkinton. It is a view of white farm houses, with a horse-drawn carriage and trolley... 11. Poseyville, Looking West, Hopkinton, ca 1880 Poseyville (Hopkinton, Mass.); Wood Street (Hopkinton, Mass.); Woodville (Hopkinton, Mass.); Hopkinton (Mass.)-History Photographic postcard ca 1880's showing 'Poseyville' a section of wood Street in the woodville section of Hopkinton, Massachusetts. The view is of small farm houses and stone walls and it is looking west.... 12. View 1 from Methodist Church Looking north to Main Street Hopkinton(Mass.)-History; Historic buildings-Massachusetts-Hopkinton;Highland House (Hopkinton Mass.); Church buildings-Massachusetts-Hopkinton View from Church Street Hopkinton looking north to Main Street in 1880. Today the Public Library occupies the site where 3-story white house sits on left of the image. On north side of Main Street is the... 13. View 2 from Methodist Church Looking north to Main Street Hopkinton (Mass.)-History; Historic buildings-Massachusetts-Hopkinton; Main Street (Hopkinton, Mass.) View from Methodist Church steeple formerly of Church Street, looking north to the intersection of Church and Main Streets in Hopkinton Mass. Building on left of the image has a Mansard roof and a porch.... 14. View 3 from Methodist Church looking west Hopkinton (Mass.)-History; Historic buildings-Massachusetts-Hopkinton View from Methodist Church steeple, formerly of Church Street in Hopkinton, looking westward. Small farm houses are in center of image and are probably on Grove Street. Main Street is to the right, a shoe... 15. View 4 from Methodist Church looking east Hopkinton(Mass.)-History; Historic buildings-Massachusetts-Hopkinton; Church Street (Hopkinton Mass.); Church Street (Hopkinton, Mass.) View is eastward as seen from Methodist Church steeple, formerly of Church Street, Hopkinton. House in lower left corner is probably #14 Hayden Rowe Street. Note building with columns on Hayden Rowe Street;... 16. View from town center, Main Street Hopkinton looking west Hopkinton (Mass.)- History; Historic buildings-Massachusetts-Hopkinton;Central business districts-Massachusetts- Hopkinton; Main Street ( Hopkinton Mass.) Main Street, Hopkinton, MA, commercial and residential buildings, many enclosed with white fencing. View is looking west, shows commercial sign on building in right front that reads Ready Made. 17. View of Church Street as seen from Highland House, Hopkinton ca 1880 Church Street (Hopkinton, Mass.); Highland House (Hopkinton, Mass.); Methodist Episcopal Church (Hopkinton, Mass.) View to the south from the former Highland House Hotel on Main Street in Hopkinton ca 1880. Back right of the image is the white bell tower of the Methodist Church originally located on the corner of Church... select all : clear all : add to favorites results 1-17 of 17 item(s) page 1 of 1 : ( << 1 >> ) :: previous : next powered by CONTENTdm ® | Contact: June Stokoe ~ Digital Initiatives ~ C/W MARS ^ to top ^


text:
|NSFW Content
|User Rankings
|Original Content
|Funny Pictures
|Funny Videos
|Funny GIFs
|YouTube Videos
|RSS Feeds
Rank #4269 on SubscribersLevel 316 Comments: Wizard
OfflineSend mail to ultrarobbie Block ultrarobbie Invite ultrarobbie to be your friend flag avatar
Hai. Well I'm UltraRobbie and this is basically my page. I love the following: Theme Parks, Roller coasters, Disney, photography, art, writing, the Rollercoaster Tycoon series and the Sims series; which is pretty obvious seeing as my top rated content on FJ is my 'An Average Sim' compilation.
Have a nice day :D
Have a nice day :D
latest user's comments
What do you think? Give us your opinion. Anonymous comments allowed.
#33 - McBalls (04/23/2012) [-]
dude your profile pic is the gayest thing i have ever seen faggot
#18 - limey (05/05/2011) [-]
have a fap, who cares about school trips? they are mostly boring anyway...
#16 - MoaningPanda (01/04/2011) [-]
You a movie guru? Meaning, do you watch a lot of movies =p
#15 - ADeadlYLepricoN (01/01/2011) [-]
an average sim
Hit toilet with wrench for 4 hours
Hit toilet with wrench for 4 hours
#1 - waafflepwn (12/31/2010) [-]
first kiss
hearts suddenly fly everywhere,
An Avrege Sim 3 ?!
hearts suddenly fly everywhere,
An Avrege Sim 3 ?!


text:
We loved this deal too, but it's no longer available. Check out our other awesome deals here.
MJ Nail Limited
$48 for an OPI Top Ten Mini Pack
Delivered within: 15 days
1 of your friends
already grabbed this deal:
Discuss this DealStart the discussion
- Luxuriate in luscious nail colours.
- Grab an OPI Top 10 mini pack for just $48, or grab two packs for $96 from MJ Nail Limited.
- Nail the hottest looks around.
- Lacquer up from a selection containing more colours than a rainbow.
Bid bye bye to bland nails, and lacquer up with a luscious, luxurious shade (or ten). Grab an OPI Top 10 mini pack for just $48, or grab two packs for $96 from MJ Nail Limited.
- Size: 3.75ml
- NL L100 Alpine Snow - opaque white
- NL S86 Bubble Bath - semi opaque pink
- NL F16 Tickle My France-y - sophisticated neutral
- NL H59 - Kiss Me on My Tulips - shocking hot pink with creme finish
- NL H61 Red Lights Ahead...Where? - coral red creme
- NL N25 Big Apple Red - deep red creme
- NL H08 I'm Not Really a Waitress - light deep red with trace flecks of gold
- NL F15 You don't know about Jacques! - neutral muddy creamy grey
- NL H63 Vampsterdam - deep plum with silver frost
- NL W42 Lincoln Park After Dark - deep dark plum creme
MJ Nail Limited
(09) 414 2977
Business in trade
ConditionsFor one pack pay $5 for delivery for the first item & $1.10 for each subsequent purchase, for two packs pay $10 for delivery for the first item & $6.10 for each subsequent purchase. Enter address when purchasing. Excl. PO Box & rural addresses. No refunds, no cash back, not to be used with any other offers.
See the rules that apply to all deals Delivery Timeframe: 15 days
More Great Deals
More Great Waikato Deals
A1 Carpet Cleaners
Beauty by HENDRIHETTE
The Yardhouse
Otorohanga Kiwi House and Native Bird Park
Valentines Victoria St
Clinic Indulge
Hinterland Adventures
ICE Driver Training
Homestead Bar and Eatery
The Yardhouse
Loxy & Co Eatery
Raglan Watersports
Anarchy Boarding Park Taupo
Thai Family Restaurant
Pamela's Castle
Diamond Photo
Collier Apartments - New Plymouth
Greenleaf Nurseries
The Peaks Motor Inn
Blue Ocean Charters
Go Asia Travel
Whanga Bridge House
Tailors Mark
Total Health Dentistry
The Shaw Academy
Deals in Other Regions
Getting more bang for your buck
Good news:
If you don't use your coupons before they expire, they're still worth the money you paid for them for an extra three months.
GrabOne FaceValue gives you another three months after your coupons expire, making it even easier to enjoy businesses all over New Zealand.
How does it work?
- A coupon is valid up until and including the expiry date printed on the coupon.
- If you don't use it before the expiry date for whatever reason, the coupon retains the value you paid for it for an additional three months.
- This means you can turn up to the business up to three months after the coupon has expired and put the money you spent to buy that coupon towards the service or experience printed on your coupon.
For example, if you spend $50 on a $100 dining voucher but don't use it before the expiry date, you will still be entitled to $50 worth of food and beverage services at that business for an additional three months.
The same goes for coupons without monetary values assigned to them. For example, if you buy a bungy jump deal but don't use it before the expiry date, you can still put the money you spent on the coupon towards a bungy jump, for another three months. Remember, the FaceValue of your coupon can only be put toward the service or experience printed on your coupon.
A few things to note:
- FaceValue applies to all deals that display the FaceValue icon. If the icon is not on a deal, FaceValue does not apply.
- It's always best to use your coupon before the expiry date, so you get the most value for your money. And if you're a bit forgetful, we now automatically remind you if your coupons are about to expire.
- During the FaceValue period, your coupon can only be put towards the service stated on the coupon.
- If the offer is seasonal, like a seasonal menu or chimney sweep service, the FaceValue of your coupon can be put towards a similar offer at the merchant's discretion.
- FaceValue does not apply to product deals, travel and accommodation-related deals, or time-dependent event deals.
- The conditions on your coupon still apply during the FaceValue grace period.


text:
Western Showdown: Saving the Klamath
It was a dramatic scene in a classic Western water war: Thousands of dead fish, washed up on the shores of the Klamath River. A move meant to help farmers—using Klamath water to irrigate crops—triggered a loss for Indian tribes and the salmon.
That was five years ago, when a detente in the battle was nowhere in sight.
As with many Western rivers, irrigators own nearly all of the water in the Klamath. The river, which straddles the border between Oregon and California, irrigates fields and generates electricity, but it also serves as fish habitat.
The Klamath River was once the third largest salmon fishery on the West Coast, producing roughly a million salmon a year. The upper reaches of the Klamath were originally enormous wetlands and lakes that served as a stopover for millions of waterfowl migrating along the Pacific Flyway, a nursery for tens of millions of fish, and home to two unique species of suckers.
The conflict between Klamath-area farmers and fishermen has lasted for decades, complete with lawsuits and public relations campaigns, a disastrous political intervention, and a thrilling finale. But this year, after 15 years of meetings, an agreement was forged to allow the parties to share water; a related agreement calls for removing four dams. The linchpin? The Yurok and Klamath tribes.
Indian treaties from the 19th century give the Yurok and Klamath the right to speak for the salmon. Through these treaties, the tribes established the salmon's right to water and required that the river be managed with the health of migrating salmon in mind. Since Indian treaty rights predate the farmers' rights, salmon have priority over crops.
In 1994, the Yurok formed a fisheries program to develop the legal, political, and biological expertise to restore the Klamath Basin. "We're salmon people," says Yurok tribal member Troy Fletcher. "The existence of the Yurok people depends on the health of the Klamath and its fisheries. This is something the creator provided the tribe, and it is the responsibility of the tribe to have healthy fisheries."
But first, a deal had to be made.
How the Water Was Won
Water is scarce in most Western states, and the laws governing its use date all the way back to the mining days of the 1800s, when mine owners diverted the high mountain streams to power mills that crushed ore; open-pit miners also used water to separate gold from gravel. But rather than allow one person to divert the entire stream, individual mining camps divided the flow into water rights based on the location of the diversion, the amount of water taken, and the date the right was established. Water courts, set up shortly after Western territories became states, enforced these rules. A water right keeps its original date no matter how many times it's bought and sold; earlier rights have priority.
When ranchers and farmers moved in, salable water rights worked as a way to cope with low rainfall. Farmers without a stream running through their property, for example, could buy rights to use water from a neighbor's stream. Ranchers and farmers own between
75 percent and 95 percent of the surface flow in Western states, while government-funded dams have helped provide water for holders of more recent water rights—cities. By the 1960s, most Western rivers were dammed, and irrigators with frontier-era water rights drained many rivers. Since then, fish populations have crashed, and rivers have become battlegrounds for fishermen, farmers, ranchers, tribes, utilities, businesses, environmentalists, and recreationists.
With modern irrigation systems, farmers can cultivate the same acreage using much less water. But according to mining-era laws, you lose rights to water you don't use. So across the West, farmers grow wet-weather crops on arid land with inefficient irrigation methods in order to avoid losing their water rights. Meanwhile, cities run dry. In a reasonable world, some of a river's flow would be diverted for agriculture, and some of the flow would remain in the river to nurture the fish. But when water is privately owned, those management decisions are more difficult. Take the Klamath Basin, where farmers own 93 percent of the surface water.
That means, we rely on support from our readers.
Independent. Nonprofit. Subscriber-supported.