PHP

A real Solar application

Posted in Solar on April 24th, 2009 by Jon – 2 Comments

I wrote a web-based application for my dad recently using, you guessed it, Solar. He had been using a really old version of Quattro Pro for keeping track of all his receivables, invoices, etc. He finally got a new computer, which was 64-bit and Vista, and he couldn’t even load Quattro Pro onto it, so it was time to find a new solution. This, IMHO, was a bit of a blessing. (Holy crap! I haven’t done my taxes yet!!!). Anyway, I offered to create a database and a web-based application that would sever existing ties between the data and presentation. He’s pretty clever, so that seemed like a great idea to him.

So I created the DB, which consisted of about 8 tables and 3 views. This isn’t rocket science, but it’s a great case for a relational database. Next, I whipped up a Solar application to keep track of clients, invoices, products, receivables, etc. It’s not fancy, but it works pretty well for a version 1. One of the coolest things about it – thanks to Solar, I didn’t write a single SQL query! The Solar models worked so well for me, that with a single fetch, I can get every bit of data I need, quickly and efficiently. They also make it dead simple to create or update data, complete with Super Awesome (yes, that’s capitalized and bold) form validation.

The next steps for the application will be to make it more user-friendly. It will be pretty easy to sweeten it up using jQuery UI and custom Solar view helpers. Maybe even a touch of Ajax.

Solar definitely makes my job easier.

Oh, and one of the best things about the application – it has the Solar Powered logo on it :)

Views, Layouts, and Locales

Posted in Solar on April 8th, 2009 by Jon – 1 Comment

Views and layouts are responsible for displaying content in the browser. Views are generally specific to a controller action. For example, an action method such as actionIndex() would display its output in a view called index.php. Layouts, on the other hand, are typically shared by the entire application and wrap around the view. A layout usually contains the header, footer, navigation, and the content area where the view’s output is displayed.
read more »

Screen cast: Creating a simple Solar application

Posted in Solar on March 27th, 2009 by Jon – 1 Comment

This is the second screen cast focussed on getting started with the Solar PHP web application framework. In this screen cast, I show you how to create a vendor namespace from the command line, create an application from the command line, and how to get data into your views.

A simple Solar application

Posted in Solar on March 24th, 2009 by Jon – 1 Comment

Introduction

Once you have the Solar PHP framework installed with a basic configuration, it’s time to create a simple application. Starting with something very simple is a great way to learn the framework. Also, you can build upon the simple application as you learn more of the features available.

This post is freakishly long for a blog post, so I paginated it. You will see some links to the pages at the bottom of each page.
read more »

Screen cast: Installing and setting up the Solar system

Posted in Solar on March 17th, 2009 by Jon – 2 Comments

Sometimes it’s difficult to properly explain in writing how to do something. You know the old expression, “a picture is worth a thousand words”? Well, sometimes, the same holds true for a video. I took a little time to create a screen cast of how I installed and set up the Solar PHP web application framework on my home computer running Ubuntu. Now, please remember, the production budget was pretty low, and I am not exactly a voice actor :)

The Solar configuration file

Posted in Solar on March 13th, 2009 by Jon – 3 Comments

The main Solar manual has a really good section on setting up and working with the Solar config file. Be sure to read the information posted there as well.

Setting up the config

Once you get Solar installed, you will probably want to tweak some settings, such as your database configuration. One of the features I like the most is Solar’s unified configuration file with its tight integration into each controller. The configuration file is simply a returned array, and entries in the configuration file use the name of the class as an array key. Those values are then available to the class via $this->_config. Below is an example.
read more »

Getting started with Solar

Posted in Solar on March 11th, 2009 by Jon – 3 Comments

Solar is a web application framework written in PHP. It follows the general Model View Controller (MVC) design pattern so those familiar with other MVC-based frameworks will have a pretty easy time figuring out how it works.

There are some good Getting Started documents on the Solar website. Much of this is taken from there with some elaboration.

Keep in mind that Solar is still in an alpha state, so you might not want to use it on production web sites. There are some changes coming in the next release which will make some of the documentation obsolete.
read more »