December 17, 2007, 8:51 am
The December issue of International PHP Magazine includes my latest article “Seamless AJAX with PRADO - An introduction to ActiveControls”. In this article I discuss some AJAX design patterns and show you how to make use of them in AJAX enabled components that ships with the PRADO framework.

Get your copy. I hope you like it.
October 2, 2007, 2:32 am
A virtual appliance (VWMare image ) with an installation of Prado 3.1 and the following components is now available.
- PHP 5.2.3 (in fast-cgi mode)
- Lighttpd 1.4.7 (mod_rewrite and fast-cgi enable)
- Prado 3.1 (including demos)
- PostgreSQL 8.2.4
- phpPgAdmin 4.1.3
- Linux kernel 2.6.17.7
The appliance also contains networking tools such as ssh, dhcp, scp, etc. The appliance contains 2 disk images, the server disk is mounted as read-only while the data disk can grow to 4Gb.
This virtual appliance is a great way to demonstrate Prado 3.1, or functional testing, or even as an development platform.
Download Prado PHP5 Virtual Appliance (9.45 Mb).
The virtual appliance image is compressed using 7-Zip, and a VMWare player or server is required to load the image.
The login credentials are admin:admin for all areas that requires authentication (e.g. server login, database, cache).
October 2, 2007, 1:42 am
The complete Prado blog tutorial is now updated. Split over 6 videos to a sum of about 60 mins in total. Flash plugin is required.
Days 3 (b) and Day 4 diverts from the original tutorial to use the Active Record Scaffold to speed up the development.
You can also download the videos (24 Mb) to view at your own time.
There is currently no narration at the moment, but transcripts are available if you would volunteer your voice.
PS. The text editor used in the screen case is Intype which is currently free (may be not so later when the complete it). The Prado bundle for Intype and the theme used in the screen cast are also available.
September 20, 2007, 6:38 am
Well so much for increasing the frequency of PRADO Watch posts. Well my excuse was my wife having twin baby girls and I’m sting with it!
We have a lot for you today so I’ll try to be brief.
Just Checked In
Wildcards and IP filtering added to page configuration.
Pages attribute in the authorization rules can take relative page paths with wildcard ‘*’. For example, pages=”admin.Home” refers to the Home page under the admin directory, and pages=”admin.*” would refer to all pages under the admin directory and subdirectories.
IP rules are specified by a new attribute ip in authorization rules. The IP rules are used to determine if an authorization rule applies to an end-user according to his IP address. One can list a few IPs together, separated by comma ‘,’. Wildcard ‘*’ can be used in the rules. For example, ip=”192.168.0.2, 192.168.1.*” means the rule applies to users whose IP address is 192.168.0.2 or 192.168.1.*. The latter matches any host in the subnet 192.168.1.
TMemCacheSession
ForceSecureConnection
The ForceSecureConnection option was added to THttpRequest to force all generated urls to use the https prefix. If the url already is using https:// you can use $this->Request->setForceSecureConnection(false) to create links with http://.
PRADO Translations
There has been a lot of effort of late in the area of translating PRADO with kabayan putting in overtime on the Indonesian front, Eric.M and Tof have been upding and adding to the French, Shinya.K adding to the Japanese sections, xue making some updates for the Chinese translations and YOIS is doing a Spanish translation.
As a side note I’m looking for people to translate and publish PRADO Watch into more languages. More on that later.
TKeyboard
Sergey Morkovkin submitted his virtual JavaScript keyboard to the component repository back in March, well it mush have struck a cord as it’s now been added to PRADO well done Sergey.
TCaptcha and TCaptchaValidator
Well I guess xue cracked from the pressure and has included a CAPTCHA control to PRADO even with his resavations about it being beatable. Along with the validator this will be a very welcome addition to PRADO for some users.
TSlider
Hats off to tof for adding a JavaScript slider control to PRADO. Based on the script.aculo.us widget this is a great addition to the framework.
Consecutive Cells Grouping for TDataGrid
If you set the EnableCellGrouping in a column of a TDataGrid cell directly above of below each other will be grouped into one big cell. An example of what it may look like can be seen here.
The Community Component
XActiveDataGrid
Billed as full active DataGrid with the ability to do paging, sorting and editing, with praise from PRADO core developers like Carl. daneel has created a very excting component.
MediaHTMLCodeEmbedded
YOIS has created a cool component for easaliy adding videos and such to your page. With support for YouTou, Flash, Windows Media, Quick Time and Real players.
PRADO/Wordpress/BBPress integration v1.0
javalizard has out done himself with this on. In his own words.
“I’ve been wanting to share with all you something new and special. I’ve needed to use Wordpress Multiuser as blogging software (it’s supported and has new releases once in a while and people know how to use it) with PRADO. Auxiliary is the integration of BBPress too. Basically, it’s a single login system for prado, blogs, and forums.
Here
Truncated by Planet PHP, read more at the original (another 1229 bytes)
September 14, 2007, 11:20 am
I recently went to a presentation where some guys from CodeGear showcased Delphi for PHP and VCL4PHP. It’s a new product which enables PHP developers to use drag / drop and wysiwyg methods to build applications with PHP. The IDE uses VCL4PHP as the underlying framework.
This kind of tool is something that ASP.net has had for a long time (ie Visual Studio.net). Not only does it make the development process easier when it comes to building applications, but it also handles setup of applications, default configs etc. Until now there hasn’t been any tools for doing this with PHP, so I sincerely congratulate CodeGear on getting something out to the masses. Their IDE is a really nice tool with lots of potential. It ships with apache, and has lots of nice features like a integrated debugger etc. The immediate draw-back is that it runs on Windows only. My impression is that most PHP developers (atleast above hobby level) works on Linux based workstations, so I imagine getting a strong user base could prove to be difficult.
Now, why do I think that Prado is far superior to VCL, and why would it have been a better choice:
1.Exception handling
Any framework which are viable for larger scale application development should use exceptions. It’s an established way of controlling code flow and making sure the code can recover from error.
VCL: This is the first MAJOR flaw which would possibly be the hardest to fix. I’ve spent some time looking around in the VCL code, and there is some basic exception handling here and there. The problem is that most of the controls does not have any exception handling at all. This makes it very hard and tedious to control the follow when errors occur.
Prado: Usage of exceptions throughout the whole framework, with the possibility to have custom exception handlers lays the foundation implementing proper flows in the application and user friendly feedback when errors occur.
2. Usage with other PHP frameworks
A framework needs to play nice with other framework these days. There is no framework that has everything, so the coder will most likely use any given framework in addition to something else.
VCL: None of the controls I’ve seen while checking out the VCL source code are prefixed. Having controls with class names like ListView, PageControl, TreeNode etc won’t play nice with other frameworks. Also, using class names like Object and Component isn’t something you’d want to have in a framework.
Prado: All components in Prado are prefixed with a ‘T’ like TLabel, TPage, TListView ensures cooperation with other frameworks.
3. Generation of HTML code from controls
VCL: The controls implement a method called dumpContents which basically writes HTML and JavaScript tags and attributes by using echo. Some sub classing is done where the parent renders as well.
The following snip is taken from their CustomLabel code:
552 if (trim($this->LinkTarget)!=”") $target=”target=\”$this->LinkTarget\”";
553
554 $class = ($this->Style != “”) ? “class=\”$this->StyleClass\”" : “”;
555
556 echo “<div id=\”$this->_name\” $style $alignment $hint $class”;
557
558 if ($this->_link==”") echo “$events”;
559
560 echo “>”;
561
562 if ($this->_link != “”) echo “<A href=\”$this->_link\” $target
By letting most of the controls be responsible for writing the low-level HTML code it’s much harder to keep the code XHTML valid, and does not exactly scream re-use. See next point for how Prado handles this.
Prado: Controls that render contents in Prado extends TWebControl. I’d like to quote the Prado manual for TWebControl here:
“TWebControl is the base class for controls that share a common set of UI-related properties and methods. TWebControl-derived controls are usually associated with HTML tags. They thus have tag name, attributes and body contents. You can override getTagName to specify the tag name, addAttributesToRender to specify the attributes to be rendered, and renderContents to customize the body content rendering. TWebControl encapsulates a set of properties related with CSS style fields, such as BackColor, BorderWidth, etc.
Subclasses of TWebControl
Truncated by Planet PHP, read more at the original (another 7903 bytes)
September 3, 2007, 9:06 am
We’ve been working on getting drag-drop features to work in Prado for a while now, and we got it on a level which fills our needs.
The current state lets you register drags, drops and drag-drop. The most annoying limitation we have at the moment is that you only get the drop container on callback. We currently slip around that by sending our data with the callback parameters.
The demo attached here shows dragsdrops (green), drags (yellow) and drops (blue). When an element is dropped the label is updated with the name of the drop element and the callback parameter data. The callback data is currently set up in the js file and it’s only set for the dragdrop elements, but there should be nicer ways to do this.
The component only uses javascript that ships with Prado, so no external libs are required. The actual MyDraggable php class is based on another Prado component, and it probably needs some cleanup as well. The demo ships with Prado 3.1, so just unzip and set correct permissions.
Kudos goes to my co-worker Lars-Olav for getting the client side stuff to work. Javascript is not my strong side
Online demo - http://prado.eirikhoem.net/dragdropdemo/www/
Download source - http://www.eirikhoem.net/dragdropdemo.tar.gz
Update: Source file is not up to date. Will fix asap.

August 20, 2007, 4:02 pm
When Timani Tunduwani posted a message in the PRADO forums say that he had just made the switch from CakePHP to PRADO and had create prodezine.com my interest peeked and just had to find out more.
—
Tell us a little about yourself?
I am a 24 year old programmer from Seattle. I am a freelancer at heart, UNIX/Linux, PHP, Python, but i currently have a fairly large, long-term project underway for a airfare consolidator. Basically worked as a network analyst for 3 years, then switched to web programming, had about two years of .net experience and then decided to make the switch early PHP4 and haven’t looked back since.
What were you using CakePHP for?
I am currently one of the lead programmers at Justfares.com and they are planning a major overhaul of their site. It was previously ASP.net and we switched to PHP5 rather rapidly, and as a team soon realized that we needed a standardized, scalable, mature, framework to manage and streamline development. CakePHP had rapid framework growth and development, good community support, and detailed framework documentation. Our main application is going to be a fairly comprehensive airfare engine that needs to get to its maximum potential, while working at an efficient rate.
What made you start looking around for another framework?
In the end we needed a framework that was flexible, powerful, versatile, and scalable so the company could grow and be efficient in a team setting. A new project arose spanning two large organizations with intricate data models, and they had said that the data management and management of business objects was becoming extremely complicated and was now a major issue to coordinate and manage effectively. CakePHP did not really address any of these issues directly so it was time for a new solution. PRADO.
Why did you settle on PRADO over other frameworks?
There are a number of reasons but primarily was the SQLMap Data Mapper. The ability to deal with the complex business logic that had arisen was pivotal. There was an extra but minor overhead, but a small price to pay and easily rectifiable through optimizing and using accelerators. Once we discovered the Data Mapper, more discoveries arose about the benefits of PRADO such as : the component structure, controls, strong event driven programming, team integration ability, power and simplicity to name but a few.
In detail how do PRADO and CakePHP compare?
The “average programmer” can grasp the concepts of PRADO fairly rapidly and the ease of configuration allows for ideal use in team situations. CakePHP has a steep learning curve and unless you have had some RoR it is not really ideal for adding to a team and productive time is wasted on training and understanding. A drawback not really found in PRADO, we have added programmers and with simple instruction they are able and easy to integrate into team environments without wasting too much time.
PRADO is good for all! Often working with designers can be a project within itself. They are focused on aesthetics and as a developer we prefer function. In PRADO a designer can complete his tasks without needing a great detailed understanding of the framework’s architecture. PRADO takes hold of certain tasks which can be done simply using controls(GridView, Repeater…..) vs CakePHP without having to do iterations through tables, rows, columns etc.
What do you miss from CakePHP?
PRADO’s Community is strong but CakePHP’s is stronger. Good support as well as rapidly growing community, and easily accessible applications with good documentation and snippets. It would be great if the IRC channel #prado was stronger, we can enhance the PRADO wiki, with a bit of effort from everyone to compete with the Bakery, and CakeForge which are well done. But most importantly promote the framework, and participate and promote PRADO HARD!!!!
—
Wow! I know that I personally feel that Tim has really been able to find that sweet spot that PRADO fills for big team development something I’ve been pushing myself.
I hope you enjoy this interview look out for more PRADO verse other PHP frameworks posts coming soon!
August 11, 2007, 12:36 pm
When I first started using PHP on a larger scale I didn’t have any experience with frameworks, so I started creating some minor helpers which made my day easier. After my first project I came across Prado. Since I had been using .net previously I grasped the concepts really quickly, so it was love at first sight. It took around a week to get fully productive with Prado, and it’s saved me countless hours of nitty gritty work. Since I first started using Prado I’ve found the forums to be the best source for information and support when I can’t find help in the documentation. The community around Prado isn’t that big (yet), but there are quite a few people which are very active. At first I can be a bit hard to navigate around the available resources, so I’ve composed a list of links which is worth checking out:
A few nice-to-know links and blogs related to Prado:
Planet Prado
Pulls data from most of the major Prado related bloggers. Nice place to stay up to date on what’s going on in the Prado world.
Prado Roadmap
The trac-based road map for the Prado project. Shows the current milestones and planned releases, with information about which features to expect, which bugs are reported and so on.
Prado Blog Tutorial
A step-by-step tutorial on how to build a blog using Prado. Nice place for beginners wanting to learn Prado
Prado Quickstart Tutorial
The term tutorial isn’t quite fitting, since it’s more of a reference. The Quickstart is a nice reference for control and component usage in addition to documenting severa key features and concepts in the Prado framework.
Prado Component Repository
Trac set up for user-submitted components and controls. This project is still in the early stages, but worth keeping an eye on.
Prado Community Project
The Prado Community Project is a new project created by the most active users of Prado. The goal of this project is to ensure that Prado gets a growth in both users and material. There are several projects planned which looks very interesting. If you have some time to offer, please stop by the forums and help us out.
