Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

necrobyter

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    necrobyter got a reaction from troyfawkes in How to separate my html from my database php functions   
    I don't think that you necessarily need to OO a simple piece of code.
     
    Functional programming is often easier to read functional code but the key here is how you return it.
     

    $images=""; if ($numRows > 0){ $count=0; while ($row = mysql_fetch_assoc($query)) { $thumbnail="images/assets/".$row['thumbnail_image']; $images[$count]=$thumbnail; } } return $images; }
     
    Then when you call $images=getPortfolioPieces(); you'll end up with an array of image locations.
     
    Then when you want to display them you simply insert:
     

    <?php foreach ($images as $i){ echo "<img src='$i' />"; } ?>
     
    It's true that using MVC frameworks will properly separate, data / design and output and that this is a good thing, so is OO but if it's a quick and easy solution you want, traditional functional or even procedural can get the job done and is, in my humble opinion, easier to digest / debug and just gets the job done.
     
    I never have liked MVC frameworks, I do sometimes use my own for large scale systems, but it depends on how long you have to get the job done and whether it's appropriate or not.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.