Re: Introduction
| From: | Peter Cowburn | Date: | Tue, 29 Jul 2014 11:19:11 +0000 |
| Subject: | Re: Introduction | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969385090@lists.php.net to get a copy of this message | ||
Hi Brandon,
On 28 July 2014 19:21, Brandon Kelly <brandon@pixelandtonic.com> wrote:
> Hi folks,
>
> My name is Brandon Kelly. I'm the owner of a company called Pixel & Tonic,
> who writes a PHP-based commercial CMS called Craft (
> http://buildwithcraft.com/). We're big fans of PHP and
> love where it's
> headed, and are quite a bit invested in it. So this is probably overdue,
> but I would like to start dipping my toe in the community.
>
> Anyway.
>
> I just came across this code example in Twig's documentation for the
> 'matches' operator
>
> <http://twig.sensiolabs.org/doc/templates.html#comparisons> (a
> wrapper
> for preg_match):
>
> {% if phone matches '{^[\d\.]+$}' %}
>
>
> ...and had no idea what those curly braces were doing in there. Some
> searching led me to the PHP docs' Delimiters page (
> http://php.net/manual/en/regexp.reference.delimiters.php),
> where the
> {...} syntax is listed as a valid delimiter for regular expressions, but
> it's awkwardly down the page a bit, away from the other accepted
> delimiters, after talking about preg_quote(). Looks like it's a mistake -
> maybe a version control merge gone bad.
>
This looks more like a small rendering error. The paragraph mentioning
preg_quote() should be separate from the one introducing brackets as
delimiters, as you'll see in the docbook xml. Unfortunately, our renderer
makes a bit of a mess of this and the result is what appears to be one
combined paragraph. I'd like to see the brackets-as-delimiters paragraph
kept, maybe even with an example example or two to show that it's not just
curly braces that can be used.
>
> I just signed into your documentation tool via my Google account and added
> the {...} syntax to the list of accepted syntaxes at the top, and removed
> the paragraph about it, as it doesn't seem necessary. Saved it, presumably
> as a patch, so feel free to review that.
>
Saving changes to a file only adds those changes to your "work in progress"
list of files. Once you're happy with a change or changes, you can then
submit a patch which requires an extra step. Right-click the file under
the work in progress list, and choose the submit as patch for review
option. Multiple files can be added to a single patch, if needed.
>
> I expect I'll be proposing additional edits in the future, if I come
> across any other points of confusion.
>
Excellent, I look forward to it.
>
> Have a good week,
> Brandon
>