Support Center

ViMP Support

Support-Forum

 
Avatar
cchethan
Beiträge: 1
I have two tables. I'm rendering fields of two tables (user and user_education). One user can have multiple records (educations details). To edit an user's information, I'm able to retrieve only one record of particular user_education's details . How do I retrieve multiple records of the user_education table for a particular user? I'm rendering fields from both tables in single page called editSuccess().

I've created object of both forms, as shown below

foreach ($user->getUserEducations() as $edu)
{
$education = $edu;
break;
}


$this->form = new stFormProfile($user);
$this->form1 = new UserEducationForm($education);

In above code $education is a single record of user_education. I should pass an array of user_education objects ( $user->getUserEducations() ). But it won't accept a array of objects.

I'm binding values as shown below,

$this->form1->bind($request->getParameter('user_education'),
$request->getFiles('user_education'));
$this->form->bind($request->getParameter('profile'), $request->getFiles('profile'));

I'm saving the updated values using the below code,

$this->form->save();
$this->form1->save();

User table's fields are getting updated. But not for user_education table. I'm getting _csrf_token [Required.] error.

And UserEducationForm.class.php is created by Symfony itself using the database schema which I had given initially . In that schema I didn't specify any primary keys for the user_education table. So Symfony itself created a column called id with the primary key. Is this affecting anything?

I'm rendering those fields as below

print $form["username"]->renderLabel()
print $form["username"]->render()
print $form["email"]->renderLabel()
print $form["email"]->render()
print $form["firstname"]->renderLabel()
print $form["firstname"]->render()
print $form["lastname"]->renderLabel()
print $form["lastname"]->render()
print $form['skillset']->renderLabel()
print $form['skillset']->render()
print $form['years_of_experience']->renderLabel()
print $form['years_of_experience']->render()

Education Details

print $form1['college_name']->renderLabel()
print $form1['college_name']->render()
print $form1['coursename']->renderLabel()
print $form1['coursename']->render()
print $form1['percentage']->renderLabel()

I need to render multiple rows of Education details table (using foreach).
20.04.2011 15:19
 

Loggen Sie sich ein oder registrieren Sie sich, um Forenbeiträge zu verfassen.

Anfrage
Anfrage
Demo