templates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stijn Goris

    templates

    hi all,

    I m designing my first 'real' site and want to do things proper this time.
    Using dreamwaever and php I was wondering what u guys think of templates in
    conjunction with php? Do you think it is the best way to apply my site
    design to the entire site or are there better ways?

    kind regards
    Stijn


  • Stijn Goris

    #2
    Re: templates


    "Stijn Goris" <mepisto@hotmai l.com> wrote in message
    news:3fec5637$0 $20543$ba620e4c @news.skynet.be ...[color=blue]
    > hi all,
    >
    > I m designing my first 'real' site and want to do things proper this time.
    > Using dreamwaever and php I was wondering what u guys think of templates[/color]
    in[color=blue]
    > conjunction with php? Do you think it is the best way to apply my site
    > design to the entire site or are there better ways?
    >
    > kind regards
    > Stijn
    >
    >[/color]

    forgot to say that I tried dreamweavers templates but they don't seem be
    designed for a coder. Someone knows some good php template classes?

    thanks


    Comment

    • Jochen Buennagel

      #3
      Re: templates

      Stijn Goris wrote:
      [color=blue]
      > forgot to say that I tried dreamweavers templates but they don't seem be
      > designed for a coder. Someone knows some good php template classes?[/color]

      The best I know is "AwesomeTemplat eEngine"
      (http://www.pinkgoblin.com/index.php?view=scripts)

      Jochen

      Comment

      • CountScubula

        #4
        Re: templates

        "Stijn Goris" <mepisto@hotmai l.com> wrote in message news:<3fec5637$ 0$20543$ba620e4 c@news.skynet.b e>...[color=blue]
        > hi all,
        >
        > I m designing my first 'real' site and want to do things proper this time.
        > Using dreamwaever and php I was wondering what u guys think of templates in
        > conjunction with php? Do you think it is the best way to apply my site
        > design to the entire site or are there better ways?
        >
        > kind regards
        > Stijn[/color]


        Well for me (and this is for me only, everyone is differnt)

        I useualy design a web page first in Dreamweaver, dual window, I code
        gui and code inspector at same time. gui to move large stuff around,
        and code window to fix dreamweavers idea of what I want.

        After page is designed, I open it up in a text editor and pull it
        apart,
        I tend to make a few files from it

        _begin.php - all the code that makes up the main part of the page
        _menu.php - any menu area I may have (usealy the _begin file will
        include thisone)
        _end.php - code that wraps it up

        then all my pages, like index.php look like this

        <?php
        $title = "My page title"
        include_once("_ _begin__.php");
        ?>

        my poage body here or table section


        <?php include_once("_ _end__.php"); ?>


        This way any changes I make are automaticaly site wide.


        Well, just my 2 bits worth of scripting tape

        Mike Bradley
        http://gzen.myhq.info -- free online php tools

        Comment

        • rush

          #5
          Re: templates

          "Stijn Goris" <mepisto@hotmai l.com> wrote in message
          news:3fec5637$0 $20543$ba620e4c @news.skynet.be ...[color=blue]
          > hi all,
          >
          > I m designing my first 'real' site and want to do things proper this time.
          > Using dreamwaever and php I was wondering what u guys think of templates[/color]
          in[color=blue]
          > conjunction with php? Do you think it is the best way to apply my site
          > design to the entire site or are there better ways?[/color]

          Well, there are at least several opinons on that, but let's say that there
          is quite large group of people who find the combination of php and templates
          very usefull. If you would like to try them with TemplateTamer and need some
          help, just drop me an e-mail.

          rush
          --



          Comment

          • Henk Verhoeven

            #6
            Re: templates

            If you create an object in your php script and call a function on it,
            you can have the function include a skin:

            <?php
            $myPage = new MyPage();
            $myPage->handleRequest( );
            ?>

            <?php
            class MyPage extends AbstractPage {
            // you do not raally need the AbstractPage right now,
            // but i bet it will prove handy in future,
            // so just create it as an empty class

            function handleRequest()
            {
            include('skinMy Page.inc');
            }
            }[color=blue]
            >?[/color]

            The skin really is simply a php script, but it can be much like a
            template, whilst having the object do the dirty work. A skin can look
            like this:

            <!-- skinBody -->
            <table><tr>
            <td height=100%>
            <table>
            <tr>
            <td class=hoofdmenu >
            <?php $this->printMenuPart( ) ?>
            </td>
            </tr>
            <tr>
            <td class=<?php print $this->getInfoStyle () ?>>
            Information<BR> <BR><BR>
            <?php $this->printInformati onPart() ?>
            </td>
            </tr>
            </table> <BR>
            </td>
            <td height=100%>
            <?php $this->printMainPart( ) ?> </td>
            </tr></table>
            <!-- /skinBody -->

            As you see a skin is just a thin layer of layout on top of an object. If
            you restrict the skin to only call methods on the object that included
            it, you get a very consistent MVC pattern. If the work of the object
            becomes too dirty you have the method create some object of its own that
            may include another skin. This way you can separate layout from code
            without needing a template engine AND reuse code and layout however you
            see fit. If you build generic reusable object classes (TablePart,
            TabsPart, MenuPart, SelectWidget you get a simple yet powerfull user
            interfacing framework.

            Henk Verhoeven,
            www.phppeanuts.org.


            Stijn Goris wrote:
            [color=blue]
            > hi all,
            >
            > I m designing my first 'real' site and want to do things proper this time.
            > Using dreamwaever and php I was wondering what u guys think of templates in
            > conjunction with php? Do you think it is the best way to apply my site
            > design to the entire site or are there better ways?
            >
            > kind regards
            > Stijn
            >
            >[/color]

            Comment

            Working...