jQuery and jQuery Mobile on JSCon 2011, Dhaka

PHPXperts group  is one of the most active PHP community in Asia. They have arranged the first JavaScript Conference of Bangladesh on September 17, 2011 at AIUB Auditorium. It was a cool event with 250+ participants.

Our (me and Mohammad Zakir Hossain Raju) session was about jQuery and jQuery Mobile. Here is the slide –

BTW, SlideShare has featured this slide on homepage.

Continue reading

Let's do with Drupal – Simplified Admin Panel

As you (if you’v at least installed and explored Drupal) know, Drupal‘s Admin panel is not comfortable for clients. It’s mostly developer centric and not similar to other common content managing panels. But, sometimes clients may need to manage some type of content. Recently I’ve faced this situation and made a simple, generic admin panel that only offers managing selective contents. Now I am going to tell you the how I’v done it. If you follow the steps, it should take hardly 30 minutes.

Continue reading

phpXperts Seminar 2010 – the most exciting event of this year!

Yesterday, we had an excellent day at phpXperts seminar. We did 6.5 hour looong event with total 18 sessions. The participants were around 350 PHP lovers and many more from live webcast. At the end of day, it was a WOW event at phpXperts 2010!

This time, my topic was about “Caching Basics in PHP”. Here is the slide –

Continue reading

Setting up Database testing with Kohana UnitTest module

Kohana Unittest module has made testing in Kohana v3 easy and fun. Lysender wrote a cool, straight forward post about how to set it up and running. I’ll just talk here about how I have set up database testing with Kohana Unittest for my personal use. Not saying “How to set up”. Because it’s obviously not the best way to do this.

Kohana Unittest

The important thing I need to ensure for testing database is, It’s in a known state before running a test. And, changes on database made by one test will not impact on another test. So, I’ll have a separate database for testing. Which will be loaded with a predefined dataset before running each test and will be truncated after test is done. Also, I have to be careful about that, my models are executing quires on test database in testing environment. Here is how I’ve done it? -

Continue reading

Extending Zend Form Element to create customized Phone number field

Generally, Phone numbers has different parts. Such as, country code, operator code and subscriber number etc. When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. But, for better usability, along with hints, some web applications provide separate (generally 3) text fields for different parts of phone number. Also, some of them keep a separator, ‘-‘ or ‘#’ between this fields.

Now, if we try provide this feature in Zend Form, that’s possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle. Again, placing them inline in the form and putting separators needs some Decorator magic. What if we can make it simply another Zend Form Element which renders three text box (optionally with separator)? And consider their value jointly and validate them together using ordinary Zend Validators? Lets try.

What we are going to make?

Let’s visualize our Phone number field first and list what we want from it.

  • It’s Simple. It’s rendering, validation everything is like any other ordinary Zend From Elements.
  • It prints 3 text boxes for different parts of Phone number.
  • When we validate it or take it’s value, the input of these three boxes jointly will be considered as the value.
  • We can set a separator character to be printed between text boxes.
  • We can include/exclude this separators from value.

Continue reading

jQuery LED Banner – fun with jQuery!

While coming home, I’ve seen a super store showing their items on a big LED type banner. Where item names were scrolling using some lights on/off. It’s an everyday scenery, nothing special.

But I’ve come to realize soon, in back of my head, I am thinking how it can be made for web. And, LED banner has landed on earth within few hours using the wings of jQuery. Here is the fun!

jQuery LED Banner

Continue reading

Taking Zend Framework workshop on Dec, 09

Bbjobs has arranged a workshop on “Zend framework fundamental” on December, 09  and invited us (me and Emran Hasan) to take it. We agreed happily. This is (so far I know) the first formal Zend Framework workshop in Bangladesh. The workshop has been defined as –

The Zend Framework Workshop is a 5 half-day tutorial-style course that takes an in-depth look at Zend Framework and its components. The workshop is designed for experienced PHP programmers who want to learn to combine ZF concepts and structural elements to utilize the full power of this software development kit for PHP 5 applications.

As per our plan about the context of this workshop, we are going to cover the following 8 basic topics of Zend Framework in 5 days.

Continue reading

Book review: PHP Team Development

PHP Team DevelopmentThree weeks ago, I was contacted by Packt publishing asking if I’d review their new book “PHP Team Development” by Samisa Abeysinghe. I agreed and received the book. But, after reading it, I was wondering about how to tell negative things politely.

In the mean time Lorna Jane, Brandon Savage, Ken Guest, Walter Ebert and some other people wrote their review about this book. And I found, most of their opinion supports my thoughts on it. Actually, most of the things that I thought has already been said in their posts. So, I am not going to repeat them and will tell my views shortly.

This book will introduce teamwork and some development processes (XP, Scrum) to fresh devs . It has brief introduction about source control, bug tracking, continuous integration and many other important terms of software development. These may help a beginner who have made software for university assignments but never worked in a professional team. The author had intention to describe the complexity and some commonly occurring problems of software development with suggesting solutions.

It presents MVC as the way of working of a team and tried to solve everything(!) with it. As some others mentioned, the author has presented his solutions as the only way of doing something. It didn’t enlighten the readers about other available solutions. Also, a few of the topics did not seem to be related with the context of this book title.

This book mentioned about many tools, processes and methods – but most of them are not explained up to such a level that one can implement them after reading the book. Some concepts of the book seemed unrealistic to me. For example, separating teams based on concern (one team will work with model, another with view; and tie them up together later).

Like Walter Ebert said, this book seems to be a “quick ‘n dirty guide on team development” to me. About recommendation, I’d say, if you are a beginner in PHP (also in programming) and just know how to connect and retrieve data from MySQL, then the book can help you know many of the terms which you should study next. If not, then you should spend some time on finding a better book to start with.

Simple PHP PDO Wrapper : light, static, easy

A few days ago, I was looking for a PDO wrapper to work with a small PHP application. I’ve searched around and found fractalizer’s PDO wrapper nearest to my purpose. Then I just wrote my wrapper on the shadow of his one.

Let’s see what’s inside and how it works.

Features

  1. Easy to use.
  2. Works with MySQL and Sqlite.
  3. All pubic functions works statically.
  4. Connection string created internally.

Get the files

From github, you can clone/fork/ download the files.
Github repository https://github.com/ajaxray/static-pdo

The download archive/repository includes –

  • Db.php – the PDO Wrapper class.
  • DbTest.php – Unit testing class for Db.
  • DbExample.php – Example of some common uses.
  • Some other unit test related files.

Continue reading