An Introduction to XPHP
What is XPHP?
XPHP is a free class for PHP which allows for the embedding of dynamic content (web application variables, function output, etc.) in a web page, using a pure XML-based syntax. It is designed to quickly bring application functionality to your web pages, while avoiding the complexity and overhead of a full CMS suite or application scripting framework. It has been deployed on many projects from small-scale sites as a basic templating engine, to powering mid-sized e-commerce applications, to running full-fledged intensive data applications on high profile web sites.
Who's it for?
XPHP is designed for developers who want to improve the efficiency and structure of their applications without committing to a complicated, bulky framework, or involving disorganized, unsafe, and philosophically questionable pseudo-code in the delivery of dynamic content to a web page.
Basic goals of XPHP development:
- Embracing XML as a powerful programming tool and partner in PHP application development.
- The avoidance of dispersing significant application logic, whether as PHP code or otherwise, throughout individual site files which take focus off the central web application itself.
- Adhering to an extremely simple syntax, while allowing for maximum flexibility.
- Ease of development and fast code execution.
Features of XPHP:
- fast, seamless templating functionality
- ability to execute application components with advanced parameter parsing
- support for nesting/recursion, and output evaluation
- advanced output control, including flexible caching support, basic if/else statements, and variable casting
- fully aware of object-oriented programming techniques
- support for PHP extensions such as XSL, and the popular APC opcode cache
- support for pushing content
- built-in routines for performing common actions
- allows for the registration of user-defined tags and tag types
- simple implementation via output buffering, or manual parsing
- 100% pure XML syntax
- PHP 5.0+
- SimpleXML extension for PHP (enabled by default)
Did we mention that it's really, really easy to use to do some amazing stuff? To get a true sense of XPHP's functionality, we suggest that you proceed to section one of the XPHP guide "Installing and Loading XPHP" and explore how you can quickly deploy XPHP on your own site.