How to print subarray in smarty template?

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago


Following is my array title $test_data in PHP:

Array
(
    [1] => Array
        (
            [test_pack_id] => 84880f321fc957f9b28b702d5a43f57b
            [test_pack_name] => CPT General Economics
            [test_pack_desc] => This Package contains 16 chapterwise testlets</b> of 15 minutes each, 8 chapterwise tests b>of 1 hour each and 3 full syllabus testsb> of 1 hour covering syllabus of CPT General Economics.<br>
Total Tests in this Package : 27b>
            [test_pack_type_id] => 7
            [test_pack_image] => 
            [test_pack_validity_year] => 0
            [test_pack_validity_month] => 6
            [test_pack_validity_days] => 0
            [test_pack_plan] => paid
            [test_pack_price] => 359.00
            [test_pack_no_tests] => 0
            [test_pack_publish] => yes
            [test_pack_code] => 
            [test_pack_sold] => 0
            [test_pack_created_staff_id] => ff8d4a5ea6bf11dce105aa2fa7b959b8
            [test_pack_updated_staff_id] => ff8d4a5ea6bf11dce105aa2fa7b959b8
            [test_pack_created_date] => 1338298119
            [test_pack_updated_date] => 1343564534
            [test_pack_purchase_date] => 0
            [test_details] => Array
                (
                    [0] => Array
                        (
                            [test_id] => 580
                            [test_name] => CPT Testlet : Demand & Supply 1
                            [test_max_score] => 40.000
                            [test_no_questions] => 10
                            [test_attempt] => 0
                            [test_not_attempt] => 0
                            [top_score] => 
                            [avg_score] => 0
                            [lower_score] => 
                        )

                    [1] => Array
                        (
                            [test_id] => 581
                            [test_name] => CPT Test : Micro Economics
                            [test_max_score] => 50.000
                            [test_no_questions
profilepic.png
manpreet 2 years ago

First: if you need to use the key variable in your loops, give it a unique name. You named both key. Also you're not even using that key so you might skip it altogether and leave just those itemattributes.

Second: you're referring to $test_id and I don't see it defined in the code snippet you provided. If it's not defined elsewhere it won't work.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.