• Subscribe to the RSS feed!
  • Subscribe by Email
  • home
  • blog
  • dev
  • Recent Posts

    • Zend Framework 1.8 Web Application Development book review
      • on November 17, 2009
    • A book review
      • on October 11, 2009
    • Playing with Zend_Navigation and routes
      • on August 9, 2009
    • Ze Balkanic Tweetup
      • on May 31, 2009
    • Moblin, Linux for netbooks
      • on May 21, 2009
    • Back
      • on
    • Happy birthday, dear magician…
      • on May 10, 2009
    • Wordpress as CMS tutorial
      • on March 14, 2009
    • New blog - Try Open Source
      • on March 11, 2009
    • Online resources for Zend Framework
      • on March 3, 2009
  • Recent Comments

    • tariq
      • on November 19th @ 1:58 pm
    • Miguel Palazzo
      • on November 18th @ 6:31 pm
    • Robert
      • on November 18th @ 9:28 am
    • NannLaypyaeNu
      • on November 18th @ 8:53 am
    • Robert
      • on November 17th @ 11:54 pm
    • David
      • on November 17th @ 11:35 pm
    • Avram
      • on November 13th @ 11:38 pm
    • Robert
      • on November 13th @ 10:08 pm
    • Robert
      • on November 13th @ 10:08 pm
    • Avram
      • on November 13th @ 8:44 pm
  • Find me on

    • DZone
    • Google Code
    • Google Reader
    • Last.fm
    • StumbleUpon
    • Twitter
    • Vimeo
  • Friends and Blogs

    • Andrew Taylor
    • Andy Sowards
    • Bojan Pejić
    • Eran Galperin
    • Graham Smith
    • Jani Hartikainen
    • Jasper Tandy
    • Matthew Turland
    • Matthew Weier O’Phinney
    • Miff
    • Miloš Ćuković
    • Nebojša Radović
    • Nemanja Avramović
    • Nemanja Tobić
    • Nikola Krajačić
    • Nikola Plejić
    • Pádraic Brady
    • Rob Allen
    • Swizec Teller
    • Vladimir Stanković
    • WeAreJustCreative
    • Željko Stevanović
  • I use

    • 960 Grid System
    • jQuery
    • Notepad++
    • Subversion
    • Trac
    • Vim
    • Zend Framework
  • Tags

    • php
    • zend
    • framework
    • example
    • about
    • random
    • ubuntu
    • site
    • blog
    • introduction
    • apache
    • wordpress
    • linux
    • setup
    • lamp
    • book
    • svn
    • open source
    • facebook
    • comic
  • Categories

    • Blablabla
    • Development
    • Free time
    • Places on the web
    • Programming
    • Software
  • Photos

    IMG_0147.JPG
    IMG_0167.JPG
    IMG_0143.JPG
    IMG_0166.JPG

  • Archives

    • November 2009
    • October 2009
    • August 2009
    • May 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008

Zend Framework 1.8 Web Application Development book review

by Robert Basic on November 17th, 2009

A few days ago I finished reading Keith Pope’s book titled “Zend Framework 1.8 Web Application Development“, so, after letting it “rest” in my mind for a while, here are my thoughts on it…

ZF Web App Development

ZF Web App Development

First, I must point out the “language” of the book – I was expecting a text that’s hard to follow, that’s full of words and sentences requiring at least two dictionaries by my side to help me out (hey, English is not my first language!), but, it was quite an easy and, if I may add, an enjoyable read.

If you think, that you’re just gonna sit down, read the book and know all about Zend Framework, boy you’re wrong! Yes, the book explains a lot, but you’ll still need to follow the example codes along the way and play with them to get really familiar with ZF.

The book starts off with a basic application (yep, “Hello world!”), explains the bootstrapping, configuring, working with action controllers, views and handling errors… The second chapter continues with explaining the MVC architecture, the front controller, router, dispatcher… It even has a nice flowchart about the whole dispatch process, great stuff.

From chapter 3 to chapter 12, the author is taking you through a process of building a web application – from creating the basic directory structure, over the hardcore programming stuff to the optimizing/testing part. Chapter 4 gives a rather good explanation on the “Fat Model Skinny Controller” concept; chapter 8 deals with authentication and authorization; chapter 11 takes care of the optimization.

At last, my favourite part of the book is when the author has several “ways out of a problem”, he tells the good and the bad sides of each, picks out the best one and explains why did he choose that particular one. I hate it when an author just simply says: “This is the right way, trust me.”, without caring to explain why.

So, would I recommend this book to a friend who wants to start working with ZF? Absolutely.

Also, be sure to check out what Jani, Raphael and Rob have to say about this book (Jani’s and Rob’s reviews are not up yet, so I’m linking to their feeds!), too.

Happy reading! :)

Tags: book, framework, php, review, zend.
Categories: Development, Programming.
Comments: 5 comments.

A book review

by Robert Basic on October 11th, 2009

zend-book-image On Thursday (October 8th) I was contacted by mr. Priyanka Sanghvi from Packt Publishing. He made me an offer I couldn’t refuse: to write a review on a new Zend Framework book! OMG! How cool is this? Very! :)

The book is titled “Zend Framework 1.8 Web Application Development” and is written by Keith Pope (@muteor on Twitter):

This book takes you through detailed examples as well as covering the foundations you will need to get the most out of the Zend Framework. From humble beginnings you will progress through the book and slowly build upon what you have learned previously. By the end, you should have a good understanding of the Zend Framework, its components, and the issues involved in implementing a Zend Framework based application.

I’ll publish my review here, soon as I get a copy of the book (it should arrive in a week or two), so stay tuned!

Until then, happy hacking!

Reblog this post [with Zemanta]
Tags: book, framework, review, zend.
Categories: Development, Programming.
Comments: 3 comments.

Playing with Zend_Navigation and routes

by Robert Basic on August 9th, 2009
"Zend Framework" and "PHP is th...
Image by Aurelijus Valeiša via Flickr

O hai. First things first — someone should slap me for being such a lazy blogger. Somehow I lost all the motivation I had in the beginning, but looks like it’s back now :) I finally had the time to play around with the latest Zend Framework version (v 1.9 now). I managed to skip the whole 1.8.x version, so this whole Zend_Application stuff is quite new to me. I spent a few days poking around the manual and the code to make it work. And it works! Yey for me! And yey for Rob Allen for his post on Bootstrapping modules in ZF 1.8!

Zend_Tool is an awesome tool. Creating a new project is like “zf create project project_name” :) And the new bootstrapping process with the Bootstrap class is somehow much clearer to me now… Anyways, lets skip to the code.

The goal

I wanted to set up routes in such way that when a user requests a page, all requests for non-existing controllers/modules are directed to a specific controller (not the error controller). In other words, if we have controllers IndexController, FooController and PageController, anything but http://example.com/index and http://example.com/foo is directed to the PageController. This can be useful for CMSs or blogs to make pretty links. Here’s where the Zend_Controller_Router_Route_Regex stuff comes in:

$route = new Zend_Controller_Router_Route_Regex(
    '(?(?=^index$|^foo$)|([a-z0-9-_.]+))',
    array(
        'controller' => 'page',
        'action' => 'view',
        'slug' => null
    ),
    array(
        1 => 'slug',
    ),
    '%s'
    );

$router->addRoute('viewPage', $route);

Basically the regex does the following: if it’s index or foo don’t match anything, thus calling up those controllers, in any other case match what’s requested and pass it to the PageController’s viewAction as the slug parameter. The fourth parameter, the ‘%s’, is needed so that ZF can rebuild the route in components like the Zend_Navigation.

Now, when the PageController, viewAction get’s called up, we can check, for example, if a page with that slug exists (like, in a database). If it exists, show the content, otherwise call up a 404 page with the error controller. In this fancy and sexy way we can call up pages without passing ID’s or even letting the user know what part of the website is working on his request. He just request’s http://example.com/some_random_article and kaboom! he get’s the content :)

Page navigation

Oh the joy when I saw Zend_Navigation in the library! And it even includes view helpers to help us render links and menus and breadcrumbs! Yey! There are a several blog posts which go in details about Zend_Navigation, so I won’t be bothering with that. What I wanted to make with Zend_Navigation is to have a menu of all the pages rendered everywhere. Here’s where action helpers kick in. I made an action helper which makes up the structure of the links/pages. Something like this:

<?php
class Zend_Controller_Action_Helper_LinkStructure extends
        Zend_Controller_Action_Helper_Abstract{
function direct(){
$structure = array(
    array(
         'label'=>'Home page',
         'uri'=>'/'
    ),
    array(
         'label'=>'Articles',
         'uri'=>'',
         'pages'=>array(array(
                                  'label'=>'Article 1',
                                  'uri'=>'article_1'),
                              array(
                                  'label'=>'Article 2',
                                  'uri'=>'article_2'),
                         )
    )
);
return new Zend_Navigation($structure);
}
}

This is a simple example of the structure; I’m actually making it out from the database, with all the categories, subcategories and pages.

Links everywhere

To have this menu on all pages, we need to render it in the layout.phtml. Rendering is quite simple:

// somewhere in layout.phtml
<?php echo $this->navigation()->menu(); ?>

Of course, we need to pass the menu to the navigation helper somehow. To avoid doing $this->navigation($this->_helper->linkStructure()); in all the controllers, we could do that once in the bootstrap (any other ways to make it happen?):

// in Bootstrap.php somewhere in the Bootstrap class
function _initView(){

        $view = new Zend_View();
        $view->doctype('XHTML1_STRICT');
        $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');

        // our helper is in app/controllers/helpers folder, but ZF doesn't know that, so tell him
        Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/controllers/helpers');
        // now get the helper
        $linkStructure = Zend_Controller_Action_HelperBroker::getStaticHelper('LinkStructure');
        // and assign it to the navigation helper
        $view->navigation($linkStructure->direct());

        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $viewRenderer->setView($view);

        return $view;
}

There. Now we have our menu rendered on all pages. Sexy isn’t it? :)

That’s it for now. Hope someone will find this useful :) Now I gotta go, need to get ready for a punk rock concert tonight!

Happy hacking!

Reblog this post [with Zemanta]
Tags: example, framework, navigation, php, routing, zend.
Categories: Development, Programming.
Comments: 4 comments.

Ze Balkanic Tweetup

by Robert Basic on May 31st, 2009
Image representing Twitter as depicted in Crun...
Image via CrunchBase

It all started with this. Just another bored tweet from yours truly after the Sunday lunch. Followed by tweets like this and this and this and this and this. I’ll just blame the fact that it’s Sunday afternoon for the low response and that we geeks do have a life! (well, most of us… some of us…)

What’s the point?

To meet. To really get to know those people behind the avatars and tweets and funny names like “Swizec”.

Who can come?

Despite the “Balkanic” part in the name, anyone can come, no matter from where you are. Be friendly and don’t hate the geeks (geeks run the world, so, beware). One rule only: you have to have a Twitter account. On the list below you’ll read later are my friends from Romania, Hungary, Slovenia, Croatia, Bosnia and Serbia. If you have a friend from these countries and I don’t know her or him, do not worry, she or he, can come too. As long as they have a Twitter account.

When?

In autumn. September, most likely, during a weekend, when no sane person should be working. Our dear Anca had a knee surgery recently and will have another one sometimes in July and we shall wait for her to fully heal and recover! (the hashtag is #wewaitforanca).

Update: I created a twtPoll on when to organize the #balkanictweetup Please give your vote!

Where?

Budapest, Hungary. Well, that’s one suggestion. But it can be somewhere else. As long as we are together :-* It would be great to last at least one night (2 days that is), but I’m fine with more, too. One day is not possible. I expect lots of you guys there and it would be impossible to drink beers with all of you in one day only (oh yeah baby, we’re gonna have lot’s of beers). So, it would be great to find a cheap hotel where there are those fancy conference halls.

What will we do?

Chat (IRL!!!) and eat and drink and goof around and laugh and cry and sleep (NOT!) and take pictures and go do stuff and most importantly, we’ll TWEET!!!1 There will be one special event that will be important for everyone to attend: we’ll sit around in a big freakin’ circle and introduce - stand up, say hi my name is Robert, aka @robertbasic and sit down (no need for the “and I’m a Twitter addict” part, we all know that).

We also can give talks on some silly topics. We can show off our works. We can sing odes to the Twitter Bird. We really can do what we want. The sky is the limit.

Other stuff of interest

The official hashtag is #balkanictweetup.

The Tweetup tagline is “Bring netbooks and beers.”

The official #balkanictweetup Twitter account is @BalkanicTweetup.

Send all your ideas, comments, appeals to zebalkanictweetup at gmail dot com

I spent all my money on beers and women so if a good Samaritan wants to support us with buying a domain and hosting for this event that would be, like, very nice of you. You would have your own page on the official #balkanictweetup page where we praise you and your good deeds. The domain is bought by Vlad Georgescu. Thanks Vlad!

I am too lazy to make the list of my friends I promised earlier, so there will be no list for now. Sorry.

He, who likes this silly idea, drop me a love letter to zebalkanictweetup at gmail dot com with your real name (yes, Jozef, I mean, Swizec, you too!) and your Twitter username. I’ll make a list based on that.

I gotta run now. Please, share your thoughts in the comments below.

Love,
Robert :-*

P.S.: Due to insane amounts of spam, I’m moderating the comments, so please wait while I approve yours. Thanks :)

Reblog this post [with Zemanta]
Tags: random, tweetup, twitter.
Categories: Blablabla, Free time.
Comments: 10 comments.

Moblin, Linux for netbooks

by Robert Basic on May 21st, 2009

Moblin got me curios and I wanted to test it out:

Moblin is an open source project focused on building a Linux-based platform optimized for the next generation of mobile devices including Netbooks, Mobile Internet Devices, and In-vehicle infotainment systems.

Cause I don’t own (yet!) a netbook, I installed it under VirtualBox (VB from now on). The image is 666 MB big and it comes not in an .iso, but in a .img format. But, VB, a really awesome software, had no troubles booting from it. As with the majority of Linux distros nowadays, Moblin image is also a Live CD, which means you can run it, without installing it.

Installing Moblin

Installing Moblin

The preinstall process is made up from 6-7 steps: choosing the language, the keyboard layout, the timezone and, of course, the partitioning. Basically, it’s just another boring “Next-Next” process. The installation itself took around 6 minutes to finish. When it’s done, it asks for a username and a password.

The first boot went pretty quickly, considering that booting under VB takes longer than booting under regular installations. The thing about VB is that it needs, the so called “Guest Additions” installed on the guest machine, so that the guest machine can be used normally. In this case, I failed to install it: Moblin comes with one version of the Linux kernel and the additions are for another version of the kernel. This prevented me in my quest to test Moblin fully. Anyway, I’ve managed to take a few screenshots of it, all are uploaded to my Picasa profile.

The m_zone

The m_zone

There was one thing that was strange. It has a “Status panel”, from which you can update your profiles on social networks. A really useful stuff. I just opened it up and updated my Twitter profile. Almost. I wasn’t logged in to Twitter from it and Moblin didn’t say a word about it. It just happily said that my status is updated. Once I found the “Web services” panel I logged in and this time I was really updating my Twitter stream.

I really was hoping to test it normally and write a detailed review of it, but this guest additions thingy thought otherwise. Moblin is a great distro, even in this beta stage I believe it’s useful. What do you think? Did you test it already, saw it in action?

One thing’s for sure: when I’ll get myself a netbook, it’ll run on Moblin.

Cheers!

P.S.: Check out the Moblin intro, too!

Reblog this post [with Zemanta]
Tags: about, introduction, linux, moblin, netbook, open source, random.
Categories: Blablabla, Free time, Software.
Comments: 2 comments.
12345 » Last
Robert Basic © 2008 — 2009
Design & graphics by: Livia Radvanski
Coded by: Robert Basic
Home page last updated on January 3rd, 2009.
Frameworks used: Zend Framework, jQuery, 960 Grid System
Blog is powered by Wordpress
Subscribe: Entries — RSS & Comments — RSS