Javatpoint Logo
Javatpoint Logo

Read Record

Now we'll fetch the data from our table child. Here our Yiii2 folder is named as read.

Step 1 Create Model file

Create a model file child.php in frontend/models folder.

Step 2 Add action to read

In the ChildController.php file, we need to add the action actionIndex to fetch the data from the table.

Look at the above code, all code is same only action to fetch data is added in the last.

Step 3 Create View file

In the frontend/views/child folder, create a file index.php.

Step 4 Run it

Run it on the browser,.


YII Read record 1
Next TopicUpdate Record

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA