Skip navigation.

Add A Cool Zend Dojo Date Picker Form Element Without Writing A Single Line Of JavaScript

Zend Framework users know that Dojo toolkit is integrated to 1.6+ release. In the previous post I demonstrated how to add a cool Dojo date picker widget to your text input form element by manually typing the JavaScript code. In this post let us discover how to create a cool date picker form element with Zend_Dojo. As the title says you don't have to write a single line of JavaScript. Zend_Dojo does all the work for you.

Prerequisite: you are familiar with Zend_Form, Zend_Controller and Zend_Layout.

Bootstrap: Zend Framework comes with many Dojo specific view helpers. You have to instruct the view object to find Dojo view helpers.

Grab the view object and add the following line in your bootstrap file.

<?php
// Create new view object if not already instantiated 
//$view = new Zend_View();

Zend_Dojo::enableView($view);
?>

Add A Cool Date Picker With 2 Lines Of JavaScript


We have all seen drop down date pickers in web pages that are really convenient for the user. Let us see how we can build one with just 2 lines of JavaScript code. Yes, you read it right. 2 lines of JavaScript. You don't even have to know JavaScript to build a date picker in your web page.

For the impatient: Demo is here

Before: Traditional HTML form with input field
Visit the above link and take a look at the HTML only form fields that collect date information from the user. If you don't use a server side scripting language to generate the form fields you have to type a lot of select options to make it easier for the user. Populating the select fields with the desired option, especially in the case of failed validation, takes a bit more server side code. Most of you would agree that the user hates these kind of forms.

Validate URI In Form Fields With Zend Framework Custom Validator

Introduction to Zend Framework

Zend Framework is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License. Zend Framework provides many components like Zend_Form, Zend_Controller, Zend_Validate, Zend_Filter to build web secure and robust applications fairly faster.

To know more about Zend Framework visit the following websites:

Zend_Form:

Grep Command

Grep stands for “Global Regular Expression Print”. The grep is a command line utility which is basically used to search for a file / file(s) or searching for a pattern. The grep command lets you to search one or more files for a specific string and outputs line that contain the particular string. In simple, grep searches file(s) for specific text.

For example, you have a document saved on your computer and you forgot the name of the file, but you remember some words in that document. You can search for that file using the grep command with the words that you remember.

Touchpad Tap Function Won't Work On Laptop PC

Issue: The laptop PC has the PS/2 Synaptics TouchPad. The tap function or the double click function does not work out of the box on a fresh Fedora 9 install.

Solution: Add psmouse.proto=imps to the grub configuration file

Step 1: Open the grub configuration from a text editor
vi /etc/grub.conf

Step 2: Append psmouse.proto=imps to the kernel line
I am pasting the information from my computer. It may vary slightly on your computer.

Before: kernel /boot/vmlinuz-2.6.25.10-86.fc9.i686 ro root=UUID=c1c4deb3-cc72-4ce6-b76f-4c4a8d61b61e rhgb quiet

Network Manager Icon Is Not Appearing On The GNOME Panel

You want to connect to a wireless network and you can't figure out how to get the Network Manager icon to appear on the GNOME Panel. How frustrating.

Don't worry, here's how you can sort it out.

You have to make sure that

  1. Network Manager service is started and
  2. You have enabled the Network Manager Applet

Below are the steps you need to follow to get Network Manger icon to appear on the GNOME Panel


Step 1: Install Network Manager if not done already
yum install NetworkManager

Step 2: Start the Network Manager service

Getting AR242x 802.11abg Wireless PCI Express Adapter To Work On Fedora 9

Last week I helped a friend configure wireless driver on his brand new HP Compaq Notebook PC. Fedora 9 X86_64 did not detect the wireless device automatically.

The first thing I did was list all PCI devices on the laptop PC.

lspci

At the end of the output I noticed

03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)

How To Print MySQL Dates In mm/dd/yyyy And dd/mm/yyyy Formats

When choosing the MySQL field type to store dates, date is the preferred type. MySQL stores dates in the format yyyy-mm-dd which is seldom used to print dates on web pages. As a PHP developer you will eventually come across a need to convert the MySQL date format into dd-mm-yyyy or mm-dd-yyyy or another format. This post tells you how you can do that in your PHP programs.

Let us create a hypothetical situation to demonstrate the program.

Create the MySQL table.

CREATE TABLE dates (
  name varchar(30),
  birthday date
)

Insert sample data with dates.

Tip Of The Day - Disable PackageKit Update Applet

PackageKit is intended to be a great feature introduced in Fedora 9. Certainly not for me and like minded. It is rather an annoyance. It tries to update software on the computer without giving much information. It launches itself when you login to gnome and starts doing package management mysteriously. It corrupted my RPM database today. I had to rebuild the RPM database to get yum working again. Yum would simply hang and the yum processes never finished. They kept on running in the background. I thought disabling it would be a good idea.

7 Easy Steps To Play Music And Video In Fedora 8

How to play music and video(MP3, MPEG, AVI, FLV and other multimedia files) in Fedora 8?

Due to patent encumbrance codecs required to play some proprietary file formats are not shipped with Fedora 8. Codecs are the programs that encode and decode digital data. These codecs are available in the livna repository for Fedora 8. You will be able to play mpeg, mp3, avi, flv and other commonly used file formats for music and video. You will require an Internet connection to download and install these packages on your computer.

If you are using Fedora 7 proceed to this blog post.

Let us get started. Are you ready?

Syndicate content