At the current moment i am trying to land a software development apprenticeship and i have been given a test to complete however i am having a bit of difficulty understanding some of the instructions/ what to do.
Inside index.php create a PHP array containing all the cities in Italy. Loop through this array and under the"< h1>< /h1 >" tag into the following " < div class="col-xs-12 col-md-6 col-md-push-3" > < /div > " tag generate a list of all the cities starting with the letter G, B and I grouped in columns. Each column should have a header that represents the letter and underneath a body containing the list of the cities for that specific letter.
i need to hand this test in by friday. this is my one chance to acc sort my shit out and get my future together.
the parts where it says loop though the array ( i kinda get that ) and under the"< h1>< /h1 >" tag into the following " < div class="col-xs-12 col-md-6 col-md-push-3" > < /div > " tag (this i dont get).
The part "col-xs-12 col-md-6 col-md-push-3" looks like a Bootstrap predefined css: - xs means extra small devices (phones) - md means medium devices (desktop) - md-push is referring to changing the ordering of the columns It's about responsive design.
It means that for each letter, G, B and I you'll have three h1 groups (headings). Depending on the size of the browser window, the CSS will cause some of the things to auto-resize.
No, Bootstrap is like a collection of CSS classes that are already written for you. You just use them like any regular classes. The HTML code you need to generate from PHP will go somewhere inside the "body" section of your code.
i have not yet finished, i cant really figure out how to get the contents from my array grouped into each column.
The company im applying for is Aalto invest. its an investment company creating a team of apprentices and senor software developer to create a web application.
You have some html syntax errors. And you need to be more efficient with your code. Also you need to make your code more manageable so that it can be modified quickly.
For example the letters that you're looking for can be made into another array. If they ask you to modify the code to include another letter, or remove one, you just quickly modify the letters' array. Or you can make a function that takes the letter as an argument. Or you can combine the two ideas into one.
I don't see the reason here, but you should always think about writing in object oriented style or procedural style.
Before you start writing the complete code, you can try a few steps:
write just the HTML code, in a 100% valid manner, with some dummy data and make sure the browser displays the data in the way that the test requires
identify segments of code that are repeating inside the HTML code (some segments of code are static, the repeating ones will probably be dynamic)
think about defining a function that you need to write once but can be called multiple times to generate those repeating HTML segments
now that you have a very good idea about what you need to have in your page, write the necessary PHP code and replace the HTML that needs to be generated (the dynamic content)
We could give you the code but that won't help you at all. You need to come up with it by yourself, or you're not going to become a web developer.