Get Data From Tabular Input

Hello, :)

I tried to create a tabular input for entry student’s name, I take from this example Tabular Input Link

in terms of input (add, remove) are successful, but which is still a constraint on the time of storing data or getting data from the input.

I attach also an example display of the input form I have created.

and this student and classroom class model:




<?php

// student

class Student extends CFormModel {

	

	public $surname;

	public $description;

	public $name;

}


?>


<?php


class ClassRoom extends CFormModel {

	

	public $surname;

	public $description;

}


?>




in student Controller i created like this:




class StudentController extends Controller {

	

	public function actionTest(){

		$students =new studentManager();

		$model = new ClassRoom;

		

		$this->render('/student/view',array(

            'model'=>$model,

            'students'=>$students,

        ));

	}



I really want is to get the value that is in the results of the tabular input.

thank you

I was stuck with tabular input. I couldnt get my head to understand it.

At the end, I do it manually, set the input name and retrieve them manually.

So i love to know how you guy doing it.

@nguyendh

Hi :)

I try to complete each one of the cases. more carefully and try to learn from examples.

continue what you are about tabular input problem?

You miss a part in the controller, take a look at the example:




            if (!isset($_POST['noValidate']))

            {

                $valid=$model->validate();

                $valid=$studentManager->validate($model) && $valid;

 

                if($valid)

                {

                    $model->save();

                    $studentManager->save($model);

                    $this->redirect(array('view','id'=>$model->id));

                }

            }



Here you assign the values from post to the models.

thank for response. very helful :)

but i have question again

how to get value from tabular input ?

cleaned again when entering data in this process:




$model->save();

$studentManager->save($model);

this->redirect(array('view','id'=>$model->id));