Akra’s Zend Framework 1.10 Tutorial

Posted on: Feb 08, 2010 by wenbert

From Akrabat’s blog:

As a result, I have updated my Zend Framework tutorial so that it is completely current. The main change I made was to remove the _init methods in the Bootstrap as they are no longer needed. I also take advantage of the new features of the zf tool to enable layouts and create forms. It’s a shame that it gets the class name of the form wrong though!

HTML5 Canvas Tutorial

Posted on: Feb 08, 2010 by wenbert

The Paint Application from Mugtug.com is very impressive. It uses HTML5. Very responsive. I found it in HN and the hackers seemed to be impressed as well.

Around the web, people are already talking about HTML5 and Canvas as a replacement for Flash. Click here to read the Canvas Tutorial.

An example of an Object-relational Mapper in PHP

Posted on: Feb 05, 2010 by wenbert

Dennis Hotson posted in his blog a brief and good example of an ORM for PHP.

What is an Object-relational Mapper?

Data management tasks in object-oriented (OO) programming are typically implemented by manipulating objects that are almost always non-scalar values. For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a “person object” with “slots” to hold the data that comprise the entry: the person’s name, a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain “phone number objects” and so on. The address book entry is treated as a single value by the programming language (it can be referenced by a single variable, for instance). Various methods can be associated with the object, such as a method to return the preferred phone number, the home address, and so on.

However, many popular database products such as structured query language database management systems (SQL DBMS) can only store and manipulate scalar values such as integers and strings organized within normalized tables. The programmer must either convert the object values into groups of simpler values for storage in the database (and convert them back upon retrieval), or only use simple scalar values within the program. Object-relational mapping is used to implement the first approach.

The heart of the problem is translating those objects to forms that can be stored in the database for easy retrieval, while preserving the properties of the objects and their relationships; these objects are then said to be persistent.

-Wikipedia

The full source code can be found in Github.

I’m sure this will come in handy as a reference in the future. Thanks to Dennis Hotson for sharing.

A Quick Update

Posted on: Jan 29, 2010 by wenbert

Hello All. Sorry for the few updates. I have not been doing any Zend Framework / PHP related work for over a month now. I am in Aurland, Norway for a training. I will be staying here for about three months. I will be back home on April 2010.

Right now, I am thinking of starting a new pet project. I have the initial specifications in my head and I will put it into writing when I have time.

I will have more updates and Zend Framework / jQuery / PHP / MySQL / web development related soon.

Thanks!

-wenbert

Excel-like Javascript Grid Editors

Posted on: Jan 19, 2010 by wenbert

Here is quick quote:

A short list of my favorite JavaScript grid components.
How many times did you hear users asking you: “something simple, a grid like excel”?

When I was a VB programmer, oh yes, I have this dark spot on my career, and it is not the only one… this request threw me in panic. Usually what your “killer” is asking you is not what you, programmer, are thinking of (namely the power of cell functions, programmability, graph etc., that probably your “killer” does not even imagine): what they are thinking about is the editor flexibility, the ability to add columns, rows, move cells blocks, copy and paste from different sources.

After the ritual pointing-out that your application is NOT Excel, the VB solution was to adopt the standard flexGrid or the mythical TrueDbGrid that made happy both the killer-user and the victim-programmer.

The source here: roberto.open-lab.com

Zend Framework: Accessing configuration data in application.ini

Posted on: Dec 29, 2009 by wenbert

Lately, I haven’t been doing any Zend Framework related things. Although currently tied up with other stuff, I check the community from time to time. Today, I found this quick and useful tip from Akrabat.

Akra talks about how you can access your configuration that you have set in your application.ini file – your configuration file.

Since it is a short post, I will copy-paste everything here.

Zend_Application will read the data in your application.ini and make it available from your bootstrap’s getOptions() method. It then sets the bootstrap as a parameter in the front controller. Note that the top level keys are all normalised to lowercase too.

You can then retrieve the options in a number of ways.

In the controller you can do this:

    public function someAction()
    {
        $bootstrap = $this->getInvokeArg('bootstrap'); 
        $options = $bootstrap->getOptions();
    }

Outside of the controller you can do this:

    $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
    $options = $bootstrap->getOptions();

One downside is that $options is a nested array, and not a Zend_Config object. If you prefer to work with a Zend_Config object you need to create it yourself as Zend_Application discards the one it creates. The easiest way to do this is to create a new method in your bootstrap to create the Zend_Config object and store to the registry.

    protected function _initConfig()
    {
        $config = new Zend_Config($this->getOptions());
        Zend_Registry::set('config', $config);
        return $config;
    }

You can then get at your config data wherever you need it. Try not to depend too much on Zend_Registry keys though, as it can make testing harder.

Of course, the source is found here with all the comments from Akrabat’s readers.

My free Wordpress Theme: Warmth

Posted on: Dec 16, 2009 by wenbert

I got bored and spent a few days creating a theme in Wordpress. This is a quick release of the theme and I tested this in Firefox and Chrome. screenshot

You can download it here.

Nothing special except that I spent about 4 hours creating the header image for it. LOL :P

Also, I have not validated the HTML and CSS for this theme. I got tired and I need to do something else – um like play CounterStrike: Source (?). But seriously, I am starting to get busy and thought that I should finish and release this now.

And oh, by the way, Eddie Vedder is in the theme. Just wanted to share. Thanks!

I’m giving away 20 Google Wave invites!

Posted on: Dec 01, 2009 by wenbert

I have 20 available Google Invites. Leave your email below. Format it to something like youremail[AT]gmail.com or something to avoid getting spammed. Just leave your email in the Email textbox when commenting :P

First 20 legit emails will get the invites.

UPDATE:
I still have around 10 or so invites left.

CSS Buttons: Simply Buttons V2

Posted on: Nov 24, 2009 by wenbert

Thanks to Jack for posintg this.

buttons-2

And from the official Simply-Buttons V2 site:

Benefits

How it works
The markup is pretty simple, as you can see below. The thing to notice here is that both the button and link tags each have a nested-nested span tag.

<button>
  <span><span>Button</span></span>
</button> 
<a class="button">
  <span><span>Button</span></span>
</a>

Grab it here.

Ekini Edit: A gEdit Scheme that is dark and suitable for low-light conditions

Posted on: Nov 19, 2009 by wenbert

A dark scheme with reduced glare and improved readability. The scheme is called Ekini Edit, it is based on the Zendburn and Thankful Eyes.

UPDATE: Wow, this post has recently been getting a lot of attention from StumbleUpon. Please keep the fire burning by Stumbling/sharing this post. Thanks everyone!


ekini_edit

Click here to download.

How to install:

  1. Edit
  2. Preferences
  3. Fonts & Colors
  4. Add ekini_edit.xml

fonts_colors


© Copyright 2007 eKini Web Developer Blog . Thanks for visiting!