With this release we have opened up the doors of new possibilities for the Raxan PDI Framework. This document seeks to outline some of the newly added features and functionalities of the framework.
New XML Support
Have you ever had the need to query and process an XML document but you don't have the time to learn about the XML DOM or the XPath query syntax? If so, then you're going to love the new XML support that's now bundled with PDI. Within a single line of code you can query and manipulate the data you need just as if you were working with an HTML document:
// remove all retired employees
$page->source('employees.xml')->find('Employee[retired=true]')->remove();
By using your existing knowledge of HTML and CSS selectors you can now query, read and write XML data using a consistent set of APIs.
Mobile Web Application Support

Image courtesy of OpenWave v7 Simulator
Cell phone sales are expected to exceed one billion handsets per year by 2009, making mobile phones one the most widely used devices for communicating and sharing information. With an increasing number of consumers using their cell phones to access online information, the need for mobile web sites and applications are on the increase.
Starting with Beta 1, developers can quickly build mobile enabled web pages with very little effort.
// load a blank wml page and insert a greeting.
$page->source('wml:page')->content('Hello Mobile User!');
The above code will generate a basic WML page and the correct content-type. To see it in action you will need a wap-enabled mobile phone or a WAP Emulator. Visit the Mobile Application Demo.
One benefit of using PDI is that the functions and methods are consistent throughout framework, so you don't need to learn any new API when working directly with HTML, XML or WML documents. Best of all, you can use your existing CSS selector knowledge of query the document structure.
$page['input#name']->val('Enter your name');
Template Binder
Some people say that a picture is worth more than a thousand words. But nothing could be more pleasant than for a developer to be able to picture all the creative possibilities with the new Template Binder API. In a single call, you can bind your dataset to elements within the page. For example:
$page['table tbody']->bind($dataset); // or use RichAPI::bindTemplate()
And when you're ready to create that eye candy display, the Template Binder will be waiting with lots of options for you to choose from:
$page['table tbody']->bind($dataset,array(
'tplFirst' => '...html code here...',
'tplLast' => '...html code here...',
'tplAlt' => '...html code here...',
'tplSelected' => '...html code here...',
'key' => 'empno',
'selected' => 1456,
'pageSize' => 10,
'page' => 1,
'format' => array(
'birth_date'=> 'd-M-Y'
)
));
Use the format option to format the display for a specific field. Valid formats are: integer, float, money, escape, date (see php date format), number, capitalize, replace (uses regex)
In addition to the new options listed above, we have added support for binding index-based arrays and RichWebPage elements to a template. This means that you can use parts of an existing web page or an XML document to supply the data you need to bind to the template. We have also added three new template fields that can be used for displaying additional information: {INDEX}, {VALUE} and {ROWCOUNT}. The INDEX and VALUE fields are only available when binding to index-based arrays or RichWebPage elements.
// example of binding a template to the Employee elements from an XML document.
$employees = $xml['Employee[retired=true]'];
$page['#retired']->bind($employees);
Here are a few ideas of things that you can do with the new Template Binder: Populate tables, ordered and unordered list items, forms, menus, grid items, blog listing, photo galleries, slideshows, banner rotation, content rotation.
See an example of the Template Binder in action by visiting the Employee Search Box
Easy Pagination
Adding a pager to your newly generated grid display is just as easy as creating the grid itself. All that's needed is a single call to the RichAPI::paginate() function:
$html = RichAPI::paginate($totalPages, $currentPage);
Or use your own custom templates
$html = RichAPI::paginate($totalPages, $currentPage, array(
'tpl' => '...html code here...',
'tplSelected' => '...html code here...',
));
The possibilities are endless when you think of the wide variety of pagers that you can create with your own custom templates.
New Event Binding Options
If you think the first set of event options (ajax callback, etc) were cool, then you're going to love the new set of super cool options that are now available at your disposal:
The Auto-Disable Option (autoDisable) - Used to automatically disable/enable elements before and after a callback. This option can be used to prevent users from accidentally submitting a web form more than once.
Auto-Toggle (autoToggle) - Used to toggle (show/hide) elements before and after a callback. This can be used for showing pre-loaders during a callback.
The Delayed callback option (delay) - Delays the callback for a specified number of seconds.
Character Input Cache (inputCache) - Delays the callback until the specified number of characters have been entered. Works only with textbox inputs. You can use this option to add auto-complete widget functionalities to your web page.
Other Improvements & Stability
Here are a few things worth noting in this beta release.
New RichWebPage::responseType - This property makes it easier to generate standard compliant web pages. By default this property is set to generate HTML5 (html) standard web pages. Possible values include: xml, html, xhtml xhtml/html, wml
New CSS selector support - These new selectors can be used to query elements within an html, xml or wml document:
:even
:odd
:empty
:not(selector)
:lt(index)
:gt(index)
:contains(text)
[attribute]
[attribute=value]
[attribute!=value]
[attribute^=value]
[attribute$=value]
[attribute*=value]
[attribute~=value] (case-insensitive lookup)
Remote HTML web pages - It's now possible to access remote (http://) web pages using the RichWebPage class. For example:
$url = 'http://www.google.com/search?q=pre+vs+iphone';
$page = new RichWebPage($url);
$titles = $page['h3'];
foreach($titles->get() as $node){
echo P($node)->html()."<br />\n";
}
New Timeout Event - Binds a timer to a server-side event. You can specify the timeout interval in milliseconds (>1000) and the number of repeat cycles. It also uses the same options as that of the bind() method. For example:
$page['div#photo']->timeout('#15000', 'change_photo'); // one-time callback
// or
$page['div#photo']->timeout('#15000', array(
'callback'=>'change_photo',
'repeat'=> 4, // trigger the event 4 times
));
For a complete list of changes see the ChangeLog.
SVN Repository
With this and future releases you will be able to gain direct access to the source code from Raxan SVN repository. By using your favorite SVN toolkit or IDE you can quickly checkout the latest source code.
Posts: 23

Reply #22 on : Thu September 26, 2013, 04:00:08
Posts: 23

Reply #21 on : Sat September 28, 2013, 03:01:23
Posts: 23

Reply #20 on : Sat October 05, 2013, 04:10:23
Posts: 23

Reply #19 on : Mon December 23, 2013, 12:02:42
Posts: 23

Reply #18 on : Tue December 24, 2013, 08:25:13
Posts: 23

Reply #17 on : Tue December 24, 2013, 08:33:51
Posts: 23

Reply #16 on : Thu December 26, 2013, 10:44:07
Posts: 23

Reply #15 on : Sun July 13, 2014, 21:52:48
Posts: 23

Reply #14 on : Sat September 13, 2014, 20:33:47
Posts: 23
Reply #23 on : Sun September 15, 2013, 12:45:31