Jump to content

Search the Community

Showing results for tags 'inherritance'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Long ago I started with a php function that generated an html select list from a mysql table. Over time, I've needed versions that did various things differently (two fields displayed between the <option> and </option> or a div displayed based on the selected value) so I've kept building new versions. Every time I build a new version I think "boy I should make a class and extend it to do things the new way" but I never have and now I must have half a dozen versions of the code. Today I sat down and started coding my class and quickly realized that I need to actually figure out what I put in the parent class and where I draw the line and create another class based on the first. Mostly I code procedural and I could really use some help thinking this through. Here's what I have in terms of permutations that I want to accomplish: Build an SQL select set a where clause set an order by select multiple columns to concatenate as labels (for example: <option citycode='$cid'>$city, $state, $country</option> ) Build html Allow list to start with value ='' (eg <option value=''>Choose a state</option> <option value='AK'>Alaska...) set a selected= value (or values for multiples) <div> s No <div> display Display of a <div> if other is selected input type=text textarea Display of a <div> for each value seected Types Select list single or multiple Radio checkboxes So, do I create a class with methods for each type of html list and a child class for the divs? A parent with the divs and children where I override the method that created the html for radio and checkboxes, something else entirely? Thanks, David
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.