PRADO Anyone?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Ward
Forum Commoner
Posts: 74
Joined: Thu Jul 13, 2006 10:01 am

PRADO Anyone?

Post by Ward »

I'm curious if anyone here has had much experience with PRADO? I have been toying with PRADO 3 for a couple of weeks now, and so far it's awesome. I'm familiar with .NET, so PRADO comes fairly easily, since it works in a similar method. Has anyone here actually written a complete application in it? If so, how is the performance? PRADO 3.x is still very new, so it's hard to find sample code. Also, the documentation isn't complete, which makes it hard to figure out what some controls do.

My favorite thing so far has to be the form validators, which are modeled after the .NET validators. This was one of my favorite things in .NET, and now I can do it in PHP :D Also, the viewstate ability is nice, allowing you to code more like a desktop app than a web app. It is supposed to have built-in AJAX support (I think it works something like ATLAS for .NET), but I haven't played with it yet.

If you haven't seen/heard of prado yet, check it out at http://www.pradosoft.com
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

If you like or are used to the .NET style then Prado is the framework for you in PHP.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it looks pretty cool. I'm going to have to check it out when I get home.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Had never heard of it, but am going to look into it.
Ward
Forum Commoner
Posts: 74
Joined: Thu Jul 13, 2006 10:01 am

Post by Ward »

This is a snippet of a test form I put together. I edit in Zend Studio, and someone wrote a prado plugin for it that adds templates for all of the prado components. This literally took about 3 minutes to write, and I went from a blank page to a fully functional form, complete with required field and regular expression validation.

PRADO completely separates UI from logic. UI components are initalized by tags in the HTML, just like .NET. If you have experience in .NET, than this should look strangely similar:

HTML Code (Display)

Code: Select all

<html>
<head>
	<title>Harold's Test Form</title>
</head>
<body>
<com:TForm>
<table class="" border="}" cellpadding="" cellspacing="">
	<tr>
		<td>First Name</td>
		<td>
		<com:TTextBox
			ID="txtFirstName"
		/>
		<com:TRequiredFieldValidator
		    ControlToValidate="txtFirstName"
		    ErrorMessage="* Required"
		    Display="Dynamic"
		    />
		    <com:TRegularExpressionValidator
		        ControlToValidate="txtFirstName"
		        ErrorMessage="* Invalid"
		        Display="Dynamic"
		        RegularExpression="[A-Za-z].*"
		        />
		</td>
	</tr>
	<tr>
		<td>Last Name</td>
		<td>
		<com:TTextBox
			ID="txtLastName"
		/>
		<com:TRequiredFieldValidator
		    ControlToValidate="txtLastName"
		    ErrorMessage="* Required"
		    Display="Dynamic"
		    />
		    <com:TRegularExpressionValidator
		        ControlToValidate="txtLastName"
		        ErrorMessage="* Invalid"
		        Display="Dynamic"
		        RegularExpression="[A-Za-z].*"
		        />
		</td>
	</tr>
</table>
<com:TButton
    ID="btnSubmit"
    Text="Submit"
    OnClick="submitForm"
    />

    <com:TTextBox
    	ID="txtOutput"
    />
</com:TForm>
</body>
</html>
Back-end code:

Code: Select all

<?php

class Home extends TPage
{
	function submitForm($sender, $arguments)
	{
		$this->txtOutput->text = "Page is valid";
	}
}

?>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

If you are looking for a framework with super-powerful templates then WACT is pretty interesting ... unfortunately there are no releases so you need to get the code from Subversion.
(#10850)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

That's pretty cool. Looks just like a .NET template.
Post Reply