DISQUS

Building Browsergames: Building Browsergames: Getting started with a templating system (PHP)

  • Michele · 1 year ago
    I have intention to use CakePHP for the next game.

    I know this framework a bit and it's very easy to mantain/change the layout, and it forces you to design your game in an object oriented way.
  • Luke · 1 year ago
    Hey Michele,

    CakePHP sounds pretty neat - I'll check it out and look into writing something about it soon.
  • Michele · 1 year ago
    I wrote a site with it http://www.mondogatto.net

    There is already security built in, and a nice thing about it is that if you change the table on the database you don't need to change methods for creating/updating/deleting records on the database, thus saving a lot of coding time.
  • Luke · 1 year ago
    Yeah. One thing that I'd like to take a look at in the future is all of the different frameworks, and potentially write a little bit about how to build a game using them - but I'm definitely going to need to research them a little bit before I can write about them and feel comfortable explaining how to use them.
  • jamal · 1 year ago
    i'm having alot of trouble with smarty -.- How would i use smarty on 000webhosting.com ? its a free server but im only practising php. but if this project is successfull i will make my own server or pay for one
  • Luke · 1 year ago
    Hi jamal,
    If you're having trouble getting up and running with Smarty, I would
    recommend that you contact support for your hosting plan and see if they can
    install it for you.

    If that doesn't work, you can also upload the entire Smarty library to a
    local directory, and then just reference that in your PHP files instead of
    an install directory.
  • MrLollige · 8 months ago
    I don't understand it either. I can of course install smarty on my devserver, but once I go public, and will not have my own server but just a standard hosting service, I will not be able to for example modify the php.ini which is required according to the installation tutorial.

    Uploading the entire smarty libary to a local directory... That would not solve all my problems easily right? I would need a system that does not require anything more than FTP and database access... :/
    Lets have a look at cakePHP.
  • Luke · 8 months ago
    I'm not quite sure where the problem with keeping smarty in your local
    directory is - as all you need to use Smarty is FTP access(not even
    database).
    As far as I'm aware, CakePHP is a lot more work to install than Smarty, as
    it's a framework instead of just a templating engine - so I don't think that
    CakePHP is the solution to your problems either.
  • MrLollige · 8 months ago
    Yup, I indeed figured that.
    However, at the moment I am still working without smarty, just because I want to fully understand exactly what is happening. Maybe I will implement smarty later on, but for now I do not really feel the need for it.
    Thanks again for your great tutorial!
  • Patrik · 10 months ago
    Hello! now you maybe will think iam an total noob, but i have some trouble getting Smarty to work i should put it on the web server i have an some how install it there ? and the server i use to try this stuff out is not mine juste my schools server so i cant install everything there but the thing is shoul i just edownload the version change some names,configfiles and put it on the server and edit my .php files and it should work ???

    plz dont bully me iam kinda new at this :P
  • Customer Retention · 10 months ago
    Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I've added you guys to my blogroll
  • Luke · 10 months ago
    I've definitely considered it, but unfortunately I don't really have the
    time right now - I had to actually switch to only writing twice a week back
    in november because life got so busy!
    Contributors are more than welcome to post videos, but I'm afraid that I
    won't be right now - perhaps when my schedule gets a little less hectic.
  • Chris Black · 1 month ago
    well... too bad the tutorial ends here for me... :(
    the "smarty" installation is not too easy to configure... at least for a human just learning PHP like me. I was sucessful in the previous steps of all this... never a fail! so, I feel happines! :P but.. with this...
    There is some way to do this part without the use of that? I mean... If I need some kind of skin for the game... man! long life to CSS!! I have in mind other look for my game (if I can learn some of this...) I mean... it is really necesary the use of "Smarty" for all this? The tutorial here is the best I found around the Net to learn all this stuff. It's perfect even for a noob like me. I just fail for the inclussion of this stuff here... :(
    if someone can help me to translate the codes without the use of the so called "Smarty" it could be great help... I know you guys are busy people but... I'm so noob... T_T
  • Luke · 1 month ago
    Did you try following the Smarty Quick Install guide at
    http://smarty.net/quick_start.php? There is also a link to the windows
    instructions at the top, if you're not using *nix.
  • keilaniswk · 1 week ago
    Here is what to do if you have problems setting Smarty up:

    1) You should put the Smarty files in the same folder you have your site. (Just all the directories and files inside the "libs" folder that you get when you unzip).

    2) Create the following folders at the same location: "configs", "templates", "templates_c and "cache".

    3) Read this page to find the absolute path of your files/folders on your server (you will need this info to edit your "index.php" file): http://bogdan.org.ua/2007/04/30/how-to-find-abs...

    4) Use your absolute path to edit your "index.php" file.

    That is all :)

    @Luke: Your host has disabled send mail, I can't get registration mail :(
  • Luke · 1 week ago
    @keilaniswk: The e-mail issue should be fixed now - not really sure what
    went wrong there.

    Sorry about that!
  • Alexander Predl · 4 days ago
    Why not using Savant3?? I'm using this template system since 2 years and works perfectly for me. Savant3 uses php for templates. So you don't need to learn another template language. It is faster than smarty and most of all smarty has a memory leak and is instable....
  • Luke · 4 days ago
    Savant3 is a pretty nice templating engine - but no matter what engine you
    choose, there will always be someone saying "why didn't you use templating
    system X? Or Y?"(and in the extreme cases, "why did you use a templating
    system?").

    Smarty was the templating system recommended to me by a few other developers
    - so it was the one I went with.