SitePoint Sponsor

User Tag List

Results 1 to 24 of 24

Thread: protemplate

  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pro_template

    I can not use english very well,so I choiced "demo".
    so I am sorry.but I believe that pro_template is very simple,
    and everybody can understand it easily.
    if have somebody will help me expression my mean,i will thanks you very much.

    PHP Code:
    <?
      $title   
    'this is title';
      
    $content 'this is content';
     
      include_once 
    'sim_demo.htm';
     
    ?>
    Code:
    <!--
    sim_demo.htm
    <?
    print<<< HTML
    -->
    
    <b>$title</b>
    <br>
    $content
    
    <!--
    HTML;
    ?>
    -->
    open sim_demo.htm from browser,you can find it's view has no php code,because php code used html commentary.
    then please run php,you can see it's cool.
    now you can see,it used heredoc,in php4
    PHP Code:
    <?
    $demo 
    "this is demo";
    print<<< HTML
    $demo
    HTML;

    ?>
    output :this is demo
    upwards it is simple,but it show my main idea

    as it ,I have some other demos,thery will show power properties .
    - to be continued -
    Last edited by axgle; Apr 1, 2005 at 16:45.

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mvc

    if use it,phper and html designer can divide the work
    and,it has commentary,with php parse,those php code will disappear
    very importance,it divide the logic and show,and it complete use php code,not anthor code,so it is fastest!
    - to be continued -
    Last edited by axgle; Apr 1, 2005 at 16:46.

  3. #3
    Massimiliano Bruno Giordano sid egg's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GamesLib.com - the slickest, most complete and
    easily navigatible flash games site on the web.

  4. #4
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if_demo

    as it,"if-then":
    PHP Code:
    <?
      $flag 
    =true;
      
    //$flag = false;
     
      
    include_once 'if_demo.htm';
     
    ?>
    Code:
    <!--
    if_demo.htm
    <?
     if($flag==true)
      print<<< HTML
    -->
     now this will show:true <br>
    <!--
    HTML;
     else
    
    print<<< HTML
    -->
     now this will show:false<br>
    <!--
    HTML;
    ?>
    -->
    Last edited by axgle; Apr 1, 2005 at 16:22.

  5. #5
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile sql_demo

    PHP Code:
    <?
     
    /*
     suppose $data get from database as array
    */
      
    $data = array(
    0=>array('id'=>1,'name'=>'Rasmus'),
    1=>array('id'=>2,'name'=>'Zeev'),
    2=>array('id'=>3,'name'=>'Andi')
    );
     
      include_once 
    'sql_demo.htm';
     
    ?>
    Code:
    <!--
    sql_demo.htm
    <?
    print<<< HTML
    -->
    <table border=1>
     <tr>
      <td>id</td> <td>name</td>
     </tr>
    <!--
    HTML;
      foreach($data as $row)
      {
        extract($row);
        print<<< HTML
    -->
     <tr>
      <td>$id </td> <td> $name </td>
      </tr>
    <!--
    HTML;
      }
    print<<< HTML
    -->
    </table>
    <!--
    HTML;
    ?>
    -->
    and so on...
    end of my introduce,thans you read it.
    Last edited by axgle; Apr 1, 2005 at 16:27.

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wtf??

    I don't know, some people...

  7. #7
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    hi,Dr Livingston ,I am sorry to you...
    as smarty,but pro_template method it's simple template and powerful,i believe.
    Last edited by axgle; Apr 1, 2005 at 17:17.

  8. #8
    Massimiliano Bruno Giordano sid egg's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GamesLib.com - the slickest, most complete and
    easily navigatible flash games site on the web.

  9. #9
    SitePoint Guru
    Join Date
    May 2003
    Location
    virginia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, is this a package or class or, hmm.. It looks like you are just using php as, well it is... php right? what exactly is pro_template? Err, April Fools right?

    -matt

  10. #10
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    April fools? Please?

  11. #11
    Massimiliano Bruno Giordano sid egg's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GamesLib.com - the slickest, most complete and
    easily navigatible flash games site on the web.

  12. #12
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is not a package or class ,is a method but it implement template's function with php code.
    pro_template is a method that can implement MVC with heredoc and HTML's comment in php

    sim_demo.htm,if_demo.htm,and sql_demo.htm(and so on) are View
    *.php are Model or Control
    Last edited by axgle; Apr 1, 2005 at 22:34.

  13. #13
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, but we all know of this approach before you posted these examples

    What we can't understand as to why you've posted a well known, and well used method to this forum in the first place? Congratulation in finding this method, but as it's new to you, it's not new to the rest of us

    And if it's an April Fools, then it's pretty weak

  14. #14
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thinks.
    but do you really understand me?

    why do I use <!-- --> in *_demo.htm?because the layout can not see php code except variable.

  15. #15
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you really want an opinion, I'm of the opinion that it isn't very elegant.

  16. #16
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe that it isn't very elegant.but it beyond phplib's template.inc

  17. #17
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't really see what you are trying to accomplish to be honest, and the benefits of what you are doing are.

  18. #18
    SitePoint Addict n0other's Avatar
    Join Date
    Feb 2005
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe good joke

  19. #19
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is a framework with pro_template.
    if it can not explain my mean,then I give up
    Attached Files Attached Files

  20. #20
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't give up... Please continue

  21. #21
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    axgle, not being a native english speaker myself, I can understand your frustration, it's not always easy to get your point across.

    The thing is, most people here in the advanced PHP forums have gone through this whole templating thing, if you'd done a search before posting, you'd be overwhelmed by the abundance of template-discussions.

    I also understand that you think you've solved an important issue: that is that the PHP code in your templating system doesn't show up in wysiwyg editors, for it is enclosed in html comments.

    If it works for you, that's ok, if it works for you and your/a designer, that's even better. Just don't expect the people here to get into 'yet another template discussion'
    Per
    Everything
    works on a PowerPoint slide

  22. #22
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    I said as much earlier I think, we've seen it all before really. Time to move on to better and bolder things I'm afraid...

  23. #23
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    been ,Thank you very much
    -axgle

  24. #24
    SitePoint Guru
    Join Date
    May 2003
    Location
    virginia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I apologize for sounding like a jerk. I hope I can contribute a useful comment next time... Cheers!


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
  •