Dojo and Zend Framework Integration Released
The Zend Framework aims to be a top notch framework for building next generation Web applications in PHP. Dojo has similar aims on the front-end side, so they decided to join forces to provide an integration layer. If you like the combination you will have a better, tighter, way to build your applications.
What we see in the initial release is:
-
JSON-RPC Server: We are re-working the Zend_Json_Server that has
been in our incubator since, oh, what? 0.2.0? and never released to
actually follow a specification:
JSON-RPC. This
will allow it to work seamlessly with Dojo, as well as other toolkits
that have JSON-RPC client implementations. I have actually completed
work on this, though the proposal is waiting to be approved; if you want
to check it out, you can find it in the
ZF svn.The original Zend_Json_Server implementation will be abandoned. It was
never fully tested nor fully documented, which has prevented its
release. Additionally, since it implemented its own ad-hoc standard, it
did not provide the type of interoperability that a true JSON-RPC server
implementation will provide. I am excited that we will finally be able
to provide a standards-compliant solution for general availability.One final note: there are currently two different JSON-RPC
specifications, 1.0 and 2.0. My goal is to support each, though for the
time being, only version 1.0 will be supported, as that is the version
Dojo currently targets. -
dojo() View Helper: Enabling Dojo for a page is not typically as
trivial as just loading thedojo.jsscript — you have a
choice of loading it from the AOL CDN or a local path, and also may want
or need to load additional dojo, dijit, or dojox modules, specify custom
modules and paths, specify code to run atonLoad(), and
specify stylesheets for decorating dijits. On top of this, this
information may change from page to page, and may only be needed for
a subset of pages. Thedojo()view helper will act as a
placeholder
implementation, and facilitate all of the above tasks, as well as take
care of rendering the necessarystyleand
scriptelements in your page. -
Form Element implementations: One area that developers really
leverage javascript and ajax toolkits is forms. In particular, many
types of form input can benefit from advanced and rich user interfaces
that only javascript can provide: calendar choosers, time selectors,
etc. Additionally, many like to use client-side validation in order to
provide instantaneous validation feedback to users (instead of requiring
a round-trip to the server). We will be identifying a small group of
form elements that we feel solve the most relevant use cases, and write
Dojo-specific versions that can be utilized withZend_Form.
(One thing to note:Zend_Form’s design already works very
well with Dojo, allowing many widgets and client-side validations to be
created by simply setting the appropriate element attributes.) -
dojo.data Compatibility:
dojo.datadefines a
standard storage interface; services providing data in this format can
then be consumed by a variety of Dojo facilities to provide highly
flexible and dynamic content for your user interfaces. We will be
building a component that will create dojo.data compatible payloads with
which to respond to XmlHttpRequests; you will simply need to pass in the
data, and provide metadata regarding it.
Of course, you can continue to any Ajax library in conjunction with the Zend Framework, and ditto for Dojo…. but why did this match happen?
There are many synergies and similarities between the two projects and their communities, including:
- Licensing and IP: Both projects are very business friendly.
- Design affinity: Similar philosophies, including a strong emphasis on use-at-will architecture.
- JSON format used strongly in both
- Comprehensive Ajax Solution: Dojo has it all
- Standards: “Dojo not only implements published standards, but also drives them”
- Communities and support: Strong communities, with support offerings behind them
And, here is some code from a JSON-RPC demo:
-
-
<h2>Dojo JSON-RPC Demo</h2>
-
<input name=“foo” type=“button” value=“Demo”“demoRpc()”/>
-
<?
-
$this->dojo()->setLocalPath(‘/js/dojo/dojo.js’)
-
->addStyleSheetModule(‘dijit.themes.tundra’)
-
->requireModule(‘dojo.rpc.JsonService’);
-
$this->headScript()->captureStart(); ?>
-
function demoRpc()
-
{
-
var myObject = new dojo.rpc.JsonService(‘/json-rpc.php’);
-
console.log(myObject.bar());
-
}
-
<? $this->headScript()->captureEnd() ?>
-
Read more on the source site
No comments yet.
feel free to leave a comment
Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs are automatically generated. Off-topic or inappropriate comments will be edited or deleted. Email addresses will never be published. Keep it PG-13 people!
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
All fields marked with " * " are required.

