views:

23

answers:

1

Hi,

How zend framework avoid html duplication?

Example of html id duplication:

<div id="edit-form">first div</div>

<div id="edit-form">second div</div>

Case1: page that user can add same forms/subform/etc.. by himself

controller action example:

function indexMyAction(){
$form1=new MyForm();
$form2=new MyForm();
$form3=new MyForm(); 
$this->view->form1=$form1;
$this->view->form2=$form2; 
$this->view->form3=$form3; 
}

Case2: manually defined html <id> by programmer - by which rule should be done to avoid duplication?

Thanks

+1  A: 

Short answer : the framework doesn't do this kind of checks.

So either you implement them yourself, or you make sure you use unique IDs by adding some sort of UUID to the IDs you define as a programmer.

wimvds
I give new example in my question in case that framework should do that when created 3 forms in action
Yosef