Snappad

14 Aug, 2008

Getting Started with Snappad - Hello World!

Posted by: Zach In: Tutorials

So you’re hooked, right? You like the idea of seperating out your database interactions from your code and your code from your output. That’s cool. Now let me show you how to write your very first Snappad project.

What You Need

  1. A Web Server with PHP support. If you run Windows, I would suggest downloading and installing WAMP.
  2. Mod_Rewrite installed for Apache.
  3. The latest Snappad Release from our Download Center.

Let’s Roll

Now that you have Apache installed and configured, extra the Snappad archive into your Web Servers root directory. Open the snappad folder and you should see a few folders. I’ll explain what they all do.

  • config - This folder contains the configuration files for custom configuring Snappad. We’ll get to that later.
  • controllers - This folder contains all of the controllers. These are the files used to gather data and generate the content that will be presented in the view.
  • main - This folder contains Snappad’s main architecture
  • models - This folder holds models. These are basically files which control your access to data, as well as interpret the rules with how the data may be manipulated.
  • modules - This folder holds different modules for  added functionality.
  • views - This folder holds the template files which transform the data from the controllers into viewable information.

Great! Now that you at least recognize the file structure, we can start working with the system. Open the controllers folder and create a file called home.inc.php. Now open that file insert the following lines:

<?
$snappad->title = 'Welcome to My Program!!';
$content='Wow! This is Exciting!';
?>

Now, open the views folder and insert the following lines:

<html>
<head>
<title><?=$snappad->title?></title>
</head>
<body>
<h1><?=$content?></h1>
</body>
</html>

Now, visit http://localhost/snappad/  in your web browser and voilà! You are now staring into the face of your first Snappad program. Congratulations!

For those of you whom are somewhat experienced with PHP and programming already, I recommend looking through the Wiki, or reading some more Tutorials. For the rest of you, I would suggest reading some PHP Tutorials before jumping too much further into Snappad.

1 Response to "Getting Started with Snappad - Hello World!"

1 | Kelvin

April 14th, 2009 at 7:40 am

Avatar

WOW…so simple. I couldn’t believe it.
Look forward to see further development on this framework. Way better than those big player like Cake or Zend.

Comment Form

Categories

Download

Get started now by downloading the Snappad Framework!