Welcome to the Treehouse Community
Looking to learn something new?
Challenge Task 1 of 3 Stage 4
Challenge Task 1 of 3
This code creates an array of ice cream flavors and then displays them in an index.php file. However, we now also need the array of ice cream flavors in another file. Let's move the flavors array into a model file. First, in flavors.php, create a new function called get_all_flavors().
<?php // ==== INCLUDE MODEL FILE ==== require_once('flavors.php'); $flavors = array( "Jalapeno So Spicy", "Avocado Chocolate", "Peppermint", "Vanilla", "Cake Batter", "Cookie Dough" ); ?>
Hugo Paz15,620 Points
You need to pick the flavors.php tab. Then you can add the code to create the function.