Developing PHP Web Applications with the Raxan Framework By Raymond Irving
Today’s Web Standards CSS, HTML , JavaScript and PHP
How Do I Integrate These Technologies? Client-Side AJAX and Server-Side PHP HTML / AJAX Server-Side PHP
Coding the old way < button >< ?php   echo   “ Click Me ”; ? ></ button > < div >< ?php   foreach  ( $rows  as  $row ) { ? >
Modern Web Applications Advance Web 2.0 Features Extensible Architecture Should be Easy to Use and Understand
Build Rich Applications One Page at a Time Raxan for PHP
It’s Open Source (MIT/GPL) Built using Open Source Web Technology
Modular & Extensible Extend your web pages one plug-in at a time
Built for Web 2.0 Applications Integrated AJAX support
Separates Content from Logic Keep all your business logic separated from your content
Easy to Maintain and Deploy Supports simple to complex deployments
Cross Browser Support Supports Modern Web Browsers
Designed to Accelerate PHP Web Development Raxan for PHP
Turn Project Ideas into Reality Web Store, Online Inventory System, Help Desk…
Things You Need to Know <ul><li>Basic HTML & JavaScript (Optional) </li></ul><ul><li>Style Sheet Selectors </li></ul><ul><...
A Good IDE – NetBeans for PHP Having a good IDE can make difference Visit http://www.netbeans.org
Getting Started… Setting up your environment
<ul><li>A Web Server running PHP 5.1 or higher </li></ul><ul><ul><li>Install LAMP or WAMP Server Stack (see http://www.wam...
Creating Your First Raxan Web Page
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><div id=&quot; msgbox &quot;></div> </li></ul>...
Connecting the Dots Event Bindings
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=&quot; click , d...
Synchronous Page Execution Order
Synchronous Page Execution Order <ul><li>Init  - Called after the page object is created </li></ul><ul><li>Authorize  - Us...
Asynchronous Updates The AJAX connection
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=“ # click , doSo...
Asynchronous Page Execution Order <ul><li>Init  - Called after the page object is created </li></ul><ul><li>Authorize  - U...
State Management Working with a stateless client
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><form name=&quot;form1&quot; action=&quot;&quo...
Preserving Form Content
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><form name=&quot;form1&quot; action=&quot;&quo...
Degradable Web Pages What happens when JavaScript is not available?
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=&quot;#click,doS...
Data Sanitization Preventing XSS and XSRF attacks
<ul><li>Sanitize Inputs </li></ul><ul><ul><li>$post = $this->sanitizePostBack(); </li></ul></ul><ul><ul><li>$value = $this...
The Switchboard Change page content views with actions and triggers
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;index.php? sba=home &quot;>Home<...
Template Management Use standard HTML templates to quickly change the Look and Feel of your apps
Extending the framework Extend the framework with customized plug-ins Raxan::loadPlugin(' myplugin/form-mailer ');
Importing CSV Data Files Easily import csv data files with a single call $data  = Raxan::importCSV(‘ data.csv ’);
Connecting To A Database Supports all PDO supported databases
<ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><div id=&quot;list1&quot;> {first_name} {last_...
Embeddable Applications Create mini web apps that can be embedded inside an html web age <script src=&quot; myapp.php?embe...
Have Questions? Join our online forum and post your questions, feedback and comments http://raxanpdi.com/forum
Thank You Visit the main website to learn more http://raxanpdi.com
Upcoming SlideShare
Loading in …5
×

Developing PHP Web Applications with the Raxan Framework

5,859 views
5,856 views

Published on

Raxan is a powerful Open Source Application Framework that uses a set of web related technologies to deliver an integrated solution for building web applications.

Published in: Technology
2 Comments
2 Likes
Statistics
Notes

  • :)

    <b>[Comment posted from</b> http://raxanpdi.com/slide-show-raxan-for-php.html]
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • This framework looks excellent. Looks like it will really cut down development time.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
5,859
On SlideShare
0
From Embeds
0
Number of Embeds
606
Actions
Shares
0
Downloads
0
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Developing PHP Web Applications with the Raxan Framework

  1. 1. Developing PHP Web Applications with the Raxan Framework By Raymond Irving
  2. 2. Today’s Web Standards CSS, HTML , JavaScript and PHP
  3. 3. How Do I Integrate These Technologies? Client-Side AJAX and Server-Side PHP HTML / AJAX Server-Side PHP
  4. 4. Coding the old way < button >< ?php echo “ Click Me ”; ? ></ button > < div >< ?php foreach ( $rows as $row ) { ? >
  5. 5. Modern Web Applications Advance Web 2.0 Features Extensible Architecture Should be Easy to Use and Understand
  6. 6. Build Rich Applications One Page at a Time Raxan for PHP
  7. 7. It’s Open Source (MIT/GPL) Built using Open Source Web Technology
  8. 8. Modular & Extensible Extend your web pages one plug-in at a time
  9. 9. Built for Web 2.0 Applications Integrated AJAX support
  10. 10. Separates Content from Logic Keep all your business logic separated from your content
  11. 11. Easy to Maintain and Deploy Supports simple to complex deployments
  12. 12. Cross Browser Support Supports Modern Web Browsers
  13. 13. Designed to Accelerate PHP Web Development Raxan for PHP
  14. 14. Turn Project Ideas into Reality Web Store, Online Inventory System, Help Desk…
  15. 15. Things You Need to Know <ul><li>Basic HTML & JavaScript (Optional) </li></ul><ul><li>Style Sheet Selectors </li></ul><ul><li>Basic PHP Programming </li></ul>
  16. 16. A Good IDE – NetBeans for PHP Having a good IDE can make difference Visit http://www.netbeans.org
  17. 17. Getting Started… Setting up your environment
  18. 18. <ul><li>A Web Server running PHP 5.1 or higher </li></ul><ul><ul><li>Install LAMP or WAMP Server Stack (see http://www.wampserver.com) </li></ul></ul><ul><li>A Text Editor or IDE </li></ul><ul><ul><li>For NetBeans you will need to install Java JDK </li></ul></ul><ul><li>Download Raxan for PHP </li></ul><ul><ul><li>Instructions: http://raxanpdi.com/docs/installation.html </li></ul></ul>
  19. 19. Creating Your First Raxan Web Page
  20. 20. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><div id=&quot; msgbox &quot;></div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected function _load () { </li></ul><ul><li>$this-> msgbox ->text('A message from your server'); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Reference HTML element by Id HTML code Raxan startup file
  21. 21. Connecting the Dots Event Bindings
  22. 22. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=&quot; click , doSomething &quot;>Click Here</a> </li></ul><ul><li><div id=&quot;msgbox&quot;></div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected function doSomething ($e) { </li></ul><ul><li>$this->msgbox->text('A message from your server'); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Callback method Event type
  23. 23. Synchronous Page Execution Order
  24. 24. Synchronous Page Execution Order <ul><li>Init - Called after the page object is created </li></ul><ul><li>Authorize - Used to secure or grant access to the page </li></ul><ul><li>Switchboard - Called whenever a switchboard action is requested. </li></ul><ul><li>Load - Used for loading additional views/content into web page. </li></ul><ul><li>Custom Event Request - Triggers the event raised by client </li></ul><ul><li>Pre-Render - Used for making final modifications to page </li></ul><ul><li>Post Render - Called after the HTML has been rendered </li></ul><ul><li>Reply - Called just after the content is sent back to the client. </li></ul><ul><li>Finalize - Called before the page object is destroyed </li></ul>
  25. 25. Asynchronous Updates The AJAX connection
  26. 26. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=“ # click , doSomething &quot;>Click Here</a> </li></ul><ul><li><div id=&quot;msgbox&quot; xt-autoupdate=&quot;true&quot; ></div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected function doSomething ($e) { </li></ul><ul><li>$this->msgbox->text('A message from your server'); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Use the # character to make an Ajax call to the sever Used to enable automatic updates
  27. 27. Asynchronous Page Execution Order <ul><li>Init - Called after the page object is created </li></ul><ul><li>Authorize - Used to secure or grant access to the page </li></ul><ul><li>Switchboard - Called whenever a switchboard action is requested. </li></ul><ul><li>Load - Used for loading additional views/content into web page. </li></ul><ul><li>Custom Event Request - Triggers the event raised by client </li></ul><ul><li>Reply - Called just after the content is sent back to the client. </li></ul><ul><li>Finalize - Called before the page object is destroyed </li></ul>
  28. 28. State Management Working with a stateless client
  29. 29. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><form name=&quot;form1&quot; action=&quot;&quot; method=&quot;post&quot;> </li></ul><ul><li><input type=&quot;submit&quot; id=&quot;submit1&quot; value=&quot;Submit Page&quot; /> </li></ul><ul><li></form> </li></ul><ul><li><div id=&quot;msgbox&quot; xt-preservestate=&quot;local&quot; ></div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected function _load() { </li></ul><ul><li>if (!$this->isPostBack) </li></ul><ul><li>$this->msgbox->text(&quot;Page was loaded at &quot;.date('h:i:s a')); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Preserves element state during post back
  30. 30. Preserving Form Content
  31. 31. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><form name=&quot;form1&quot; action=&quot;&quot; method=&quot;post&quot;> </li></ul><ul><li><label>Enter your name:</label><br /> </li></ul><ul><li><input type=&quot;text&quot; name=&quot;text1&quot; id=&quot;text1&quot; value=&quot;&quot; />&nbsp; </li></ul><ul><li><input type=&quot;submit&quot; id=&quot;submit1&quot; value=&quot;Submit Page&quot; /> </li></ul><ul><li></form> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected $preserveFormContent = true ; </li></ul><ul><li>protected function _load() { </li></ul><ul><li>// some code here </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Used to preserve form input values during post back
  32. 32. Degradable Web Pages What happens when JavaScript is not available?
  33. 33. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;#&quot; xt-bind=&quot;#click,doSomething&quot;>Click Here</a> </li></ul><ul><li><div id=&quot;msgbox&quot; xt-autoupdate=&quot;true&quot;></div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected $degradable = true ; </li></ul><ul><li>protected function doSomething($e) { </li></ul><ul><li>$this->msgbox->text('A message from your server'); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Makes the page degradable
  34. 34. Data Sanitization Preventing XSS and XSRF attacks
  35. 35. <ul><li>Sanitize Inputs </li></ul><ul><ul><li>$post = $this->sanitizePostBack(); </li></ul></ul><ul><ul><li>$value = $this->text1->textval(); </li></ul></ul><ul><li>Sanitize Outputs </li></ul><ul><ul><li>$this->text1->textval($value); </li></ul></ul><ul><ul><li>$this->msgbox->text($value); </li></ul></ul>
  36. 36. The Switchboard Change page content views with actions and triggers
  37. 37. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><a href=&quot;index.php? sba=home &quot;>Home</a>&nbsp; </li></ul><ul><li><a href=&quot;index.php? sba=about &quot;>About us</a>&nbsp; </li></ul><ul><li><a href=&quot;index.php? sba=contact &quot;>Contact us</a> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected function _switchboard($action) { </li></ul><ul><li>switch ($action) { </li></ul><ul><li>case &quot;about&quot;: </li></ul><ul><li>$this->appendView('about-us.html'); </li></ul><ul><li>break; </li></ul><ul><li>case &quot;contact&quot;: </li></ul><ul><li>$this->appendView('contact-us.html'); </li></ul><ul><li>break; </li></ul><ul><li>default : // home </li></ul><ul><li>$this->appendView('home.html'); </li></ul><ul><li>break; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Switchboard Actions Switchboard Triggers
  38. 38. Template Management Use standard HTML templates to quickly change the Look and Feel of your apps
  39. 39. Extending the framework Extend the framework with customized plug-ins Raxan::loadPlugin(' myplugin/form-mailer ');
  40. 40. Importing CSV Data Files Easily import csv data files with a single call $data = Raxan::importCSV(‘ data.csv ’);
  41. 41. Connecting To A Database Supports all PDO supported databases
  42. 42. <ul><li><?php require_once('raxan/pdi/autostart.php'); ?> </li></ul><ul><li><div id=&quot;list1&quot;> {first_name} {last_name} </div> </li></ul><ul><li><?php </li></ul><ul><li>class NewPage extends RaxanWebPage { </li></ul><ul><li>protected $masterTemplate = 'homemade.html'; </li></ul><ul><li>protected function _load($e) { </li></ul><ul><li>$user = 'user'; </li></ul><ul><li>$password = 'password'; </li></ul><ul><li>$dsn = 'mysql:host=localhost;dbname=crmdb'; </li></ul><ul><li>$db = Raxan:: connect ($dsn,$user,$password,true); </li></ul><ul><li>$records = $db-> table ('customers'); </li></ul><ul><li>$this->list1-> bind ($records); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>?> </li></ul>Connect to database Get customer records Bind records to div element Column or field names
  43. 43. Embeddable Applications Create mini web apps that can be embedded inside an html web age <script src=&quot; myapp.php?embed[js] &quot;></script>
  44. 44. Have Questions? Join our online forum and post your questions, feedback and comments http://raxanpdi.com/forum
  45. 45. Thank You Visit the main website to learn more http://raxanpdi.com

×