Results 1 to 8 of 8
  1. #1
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default php skinning system

    hello can some one tell me they best why to make a skinning system for my script as i can not seem to make one that works were i can have {$something} and that $something is php if($hi == 1){echo 'blah'} i know it uses evil but how is it done?

  2. #2
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    sorry to post to times but i can not edit the other post :|

    i have this code but it dose not work.

    index.php
    PHP Code:
    <?php

    $template 
    file_get_contents'page.php' );
    $array = array (     'echo' => 'echo (\'hello\');'
                           
                   
    );
    // we have to somehow expand the $template variable, but how?


    eval("$template");

    ?>
    page.php
    PHP Code:
    echo 'hello'$array["echo"]; 
    but the $array["echo"]; dose not show the word hello like it should :\

  3. #3
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    What exactly are you tryin to acheive, if your first post was in-any sense to me I would of helped you. You can't do this -> $array = array ( 'echo' => 'echo (\'hello\');'

    );
    Hi, names James. I am a web developer.

  4. #4
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    Okay i suck at this bit of php what i am trying to do is make a template system were you call the page eg: page.php and it has some txt in it like

    are you logged in? {$logged}

    and in the index or some were have the $logged set as a if($hi == 1) {echo'yes';} else { echo'no';} or some thing like that

  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by VistaBoy View Post
    Okay i suck at this bit of php what i am trying to do is make a template system were you call the page eg: page.php and it has some txt in it like

    are you logged in? {$logged}

    and in the index or some were have the $logged set as a if($hi == 1) {echo'yes';} else { echo'no';} or some thing like that
    PHP Code:
    <?php
    include_once ( 'header.php' );

    if ( 
    $hi === true )
    {
        
    $logged 'yes';
    }
    else
    {
        
    $logged 'no';
    }

    include_once ( 
    'page.php' );

    include_once ( 
    'footer.php' );

    ?>
    Thats all I think you want...
    Last edited by Protege; 09-07-2008 at 10:42 AM.
    Hi, names James. I am a web developer.

  6. #6
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    okay thats one why of doing it but i am trying to make it small ish i have done it like the array why before and got it to work but i can not rememeber how i done it because i will have a lot of template pages or i could use smarty but do not know.

  7. #7
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    I have no idea what you are trying to acheive... An echo inside an array?
    Hi, names James. I am a web developer.

  8. #8
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    SMARTY?

    http://www.smarty.net/

    But it's a template engine.

Posting Permissions

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