[Solar-talk] Solar 0.23 released
Paul M Jones
pmjones at solarphp.com
Sat Aug 26 09:02:54 PDT 2006
The new release is out; you can [download][] it from the usual
location. As
always, you should read the full [change notes][].
[download]: http://solarphp.com/index.php/docs/Main/DownloadSolar
[change notes]: http://solarphp.com/channel.php?
package=Solar&release=0.23.0&downloads
Read on for some highlights.
Breaks
======
There is one backwards-compatibility break in this release. Previously,
the `Solar_View::partial()` method would output the results of the
partial template directly. Now it just returns the results. This means
that you need to change all calls from `$this->partial(...)` to `echo
$this->partial(...)`. This change makes the partial() method act like
all other view helpers.
New Features
============
Protaculous Ajax
----------------
Clay Loveless has been hard at work adding view helpers that interface
to the [Prototype][] and [Script.aculo.us][] JavaScript libraries. (I
have taken to calling this popular combination "Protaculous". ;-)
[Prototype]: http://prototype.conio.net/
[Script.aculo.us]: http://script.aculo.us/
These JavaScript packages provide all sorts of Ajaxy Web 2.0
buzzword-compliant goodness, but you generally need to access them in
JavaScript directly. Clay's view helpers for the Control and Effect
libraries of Scriptaculous let you access them via PHP. The helpers keep
track of what effects and requests you make, and load all the necessary
files for you automatically.
Clay has built the helpers so they use "unobtrusive JavaScript". This
means that you address HTML elements using CSS selectors instead of
using inline scripts on elements.
To show off some of the possibilities, Clay has added a new demo app
under `Solar_App_HelloAjax`.
JSON Support
------------
Clay Loveless has also added a new Solar_Json class for encoding and
decoding
JavaScript object notation; this helps when passing data via Ajax
requests. (The work is based on code from Michal Migurski, Matt Knapp,
and Brett Stimmerman, in their [Services_JSON][] package.)
[Services_JSON]: http://mike.teczno.com/JSON/JSON.phps
Although full JSON support will exist in a future version of PHP,
this class will help users who need the functionality right now. (Clay
has gone to a lot of effort to make Solar_Json behavior functionally
identical to the upcoming PHP JSON extension.)
Many thanks, Clay, for your continuing efforts on this portion of Solar.
Markdown
--------
[Markdown][] is a simplifed syntax and text processor that converts
structured text markup to XHTML, written by John Gruber.
[PHP-Markdown][] is a direct port of Gruber's original Perl code to PHP
4 (and non-strict PHP 5) by Michel Fortin. Now the same text-processing
capability exists in Solar as `Solar_Markdown`.
[Markdown]: http://daringfireball.net/projects/markdown/
[PHP-Markdown]: http://www.michelf.com/projects/php-markdown/
The major benefit of the Solar version over previous implementations is
that it is "plugin aware", much like the PEAR [Text_Wiki][] package.
Each syntax rule is a separate class; you can mix and match syntax rules
to fit your particular needs without having to rewrite the entire
processing and rendering engine.
[Text_Wiki]: http://pear.php.net/Text_Wiki
Solar now comes with three Markdown rule sets:
* `Solar_Markdown` proper, an implementation of the original markup
rules
in the Perl and PHP versions. It provides for headers, lists, strong
and emphasis, links and inline URIs, code examples, and much
more. In
general, it leaves HTML in place, so it may not be suitable for
untrusted or anonymous environments.
* `Solar_Markdown_Extra`, an implementation of Michel Fortin's
[PHP-Markdown Extra][] that extends the basic Markdown syntax to
support tables, definition lists, and id-able headers.
[PHP-Markdown Extra]: http://www.michelf.com/projects/php-markdown/
extra/
* `Solar_Markdown_Wiki`, which provides Mediawiki-style page links,
interwiki links, and code documentation constructs, in addition to
tables and definitions lists from the `Solar_Markdown_Extra`
rules. It
is very aggressive about escaping HTML for output, which makes it
more
suitable for untrusted environments.
(Note that this email is written in Markdown syntax; the blog post I
will make later will be converted from this syntax to XHTML. Also,
TextMate users can access the "Blog - Markdown" bundle and preview the
XHTML transformation as they are writing.)
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list