SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 58 of 58
  1. #51
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't there a rule about bringing dead threads back to life?
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  2. #52
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Quote Originally Posted by Travis
    Isn't there a rule about bringing dead threads back to life?
    Perhaps with the return of this movie genre it is time for undead threads

    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #53
    SitePoint Guru dagfinn's Avatar
    Join Date
    Jan 2004
    Location
    Oslo, Norway
    Posts
    894
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    Off Topic:



    Perhaps with the return of this movie genre it is time for undead threads

    Suggested definition of the technical term "undead thread": A thread that has a gap of more than 6 months with no postings and no substantial on-topic discussion after the gap.
    Dagfinn Reiersøl
    PHP in Action / Blog / Twitter
    "Making the impossible possible, the possible easy,
    and the easy elegant"
    -- Moshe Feldenkrais

  4. #54
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Location
    Lyon, France
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Table inheritance and DAO

    Quote Originally Posted by shoebox
    Isn't that a reason to START with databases?? To eliminate the quick solution of creating a NEW table each time you need to implement something new?


    For instance.. for a content driven website with all the standard stuff (articles, polls, comments, etc...) You can standardize the content of each of these types of 'publications' with the following scheme..
    Very interesting post. In fact to smooth that process, some DBMS like PostgreSQL support "table inheritance". See the Inheritance section of the PostgreSQL 7.4.13 Documentation. If your favourite DBMS doesn't support that powerful feature, say MySQL or SQLite, the solution is to use Data Access Objects (DAO), as PHP classes can be inherited. In your case there would be a publication class and the article class would "extend" it, adding its own "fields" to it : id, bodycopy...

  5. #55
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is this vincent of the Yapter http://yapter.sourceforge.net/ and php freakz ?
    Business as usual is off the menu folks, ...

  6. #56
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Galo
    is this vincent of the Yapter http://yapter.sourceforge.net/ and php freakz ?
    No, it's other Vincent .

  7. #57
    SitePoint Enthusiast lotrgamemast's Avatar
    Join Date
    Apr 2005
    Location
    Cheshire, England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php 
    /* AwesomeTemplateEngine.class.php */ 
    class AwesomeTemplateEngine 
        var 
    $templatePath;
        var 
    $vars;
        function 
    AwesomeTemplateEngine($templatePath) { 
            
    $this->templatePath=$templatePath
        }
        function 
    set($value$name) {
            
    $this->vars[$name] = is_object($value) ? $value->fetch() : $value;
        }
        function 
    parseTemplate($dataObject,$template) {
            
    extract($this->vars);
            
    ob_start(); 
            include(
    $this->templatePath.$template); 
            
    $strParsedTemplate ob_get_contents(); 
            
    ob_end_clean(); 
            return 
    $strParsedTemplate
        } 

    ?>
    Thats more or less exactly what I've been using for months now. Works very well and you can set variables for use in the template.

  8. #58
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > Note: This thread is more than 46 months old. Please consider creating a new thread instead.

    Why try to bring life to the dead though? There isn't anything particularly interesting or innovative about your class, I'm sorry to say


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •