How to create repeatable fields for a model's child relation

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
aaron118
Forum Newbie
Posts: 2
Joined: Fri Mar 19, 2010 2:14 pm

How to create repeatable fields for a model's child relation

Post by aaron118 »

I'm currently creating my first Yii app, and I'm really enjoying it so far. The app will be used to allow users to log their weightlifting workouts and to monitor their strength over time. Part of the app is to allow users to create their own workout routines, so for example a final workout routine might consist of:

Legs Routine A

Squat

Set 1 Target reps: 12

Set 2 Target reps: 10

Set 3 Target reps: 8

Deadlift

Set 1 Target reps: 10

Set 2 Target reps: 8

Set 3 Target reps: 6

Seated Calf Raises

Set 1 Target reps: 15

Set 2 Target reps: 12

I know how to display and use these workout routines, but I can't seem to figure out how I can go about building the feature to create them. Ideally I'd like a 'create' page where both the exercises and their sets become repeatable fields, so you can define a certain amount of each. I have attached my database schema (the routine tables are the main ones concerned) and a wireframe design for my desired create routine page to help give you guys an idea on what I'm trying to do. I would really appreciate it if someone could point me in the right direction with this.

http://aaronpitts.co.uk/schema.png
http://aaronpitts.co.uk/create_a_new_routine_mobile.png

Many thanks, Aaron
chickmiku
Forum Newbie
Posts: 1
Joined: Fri Jun 29, 2012 2:18 am

Re: How to create repeatable fields for a model's child rela

Post by chickmiku »

hmm what are you saying because we are searching material about PHP but here find child relation.
Post Reply