Advertisement
teejaybuckner

Untitled

Apr 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. For CampBase, we used Bootstrap, a front end framework for developing responsive, mobile first websites. Bootstrap uses a 12 column grid system to fluidly scale your site between different window sizes. As you can see, when Daniel resizes the window, the layout of the site changes.
  2.  
  3. [show camp.blade.php (/camps/{id})]
  4.  
  5. We also used Blade, a powerful templating engine included with Laravel, to combine multiple views into one HTML response. For instance, the navbar and footer are declared once in a view, and all the other views have an @extend() tag that allows you to include the navbar and footer in the main view. This allows for less repeated code and an overall cleaner structure, as you can now change something in the navbar and footer view and have it reflected site-wide.
  6.  
  7. [stay on camp.blade.php (/camps/{id})]
  8.  
  9. One very noticeable application of Blade is the inclusion of custom colors on each camp's page. The camp's colors are stored in the database as HEX values, then pulled into a partial view inside <style> tags. So, all you have to do is use an @include() statement at the top of a view to pull the custom_css partial into the main view, and apply the camp's colors. Again, this allows for code that is much easier to maintain and debug, as all of the color logic is in one place, despite being utilized in many.
  10.  
  11. [stay on camp.blade.php (/camps/{id})]
  12.  
  13. With this in mind, I want to show you how the dynamic form fields are displayed with Blade. Here you can see the form field that Maggie created earlier. To display this, each of the camp's form fields are iterated over and the necessary HTML is output dynamically from the database. This allows a Camp Manager to easily define custom fields that they need from a camper.
  14.  
  15. [show section.blade.php (/camps/register)]
  16.  
  17. Of course, not all functionality we needed for the site was provided by an outside package or resource. For instance, on the home page, the camp picker uses a custom jQuery script to determine what camp is being hovered over, determine that camp's image URL, calculate the margin-top attribute needed (making sure not to use a value that would make the image go past the bottom of the picker), and then, finally, render the result you see.
  18.  
  19. [show index.blade.php (/)]
  20.  
  21. Now I'm going to pass the presentation off to Candace to tell you about our third party API integration and more about the Laravel framework.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement