Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add <?php tags to all.
  • Loading branch information
harikt committed Dec 5, 2012
1 parent 5b6bdc8 commit 745b2b8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions version/1.0.0-beta1/index.md
Expand Up @@ -173,6 +173,7 @@ Available Rules
alphabetic characters. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'alpha');
{% endhighlight %}

Expand All @@ -182,12 +183,14 @@ Available Rules
Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'between', $max, $min);
{% endhighlight %}

- `blank`: Validate the value as being blank. Sanitize to `null`. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'blank');
{% endhighlight %}

Expand All @@ -197,13 +200,15 @@ Available Rules
Sanitize to a strict PHP boolean. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'bool');
{% endhighlight %}

- `creditCard`: Validate the value as being a credit card number. The value
cannot be sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'creditCard');
{% endhighlight %}

Expand All @@ -212,13 +217,15 @@ Available Rules
this is to sanitize, not validate):

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::FIX, 'dateTime', $format);
{% endhighlight %}

- `email`: Validate the value as being a properly-formed email address. The
value cannot be sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'email');
{% endhighlight %}

Expand All @@ -227,13 +234,15 @@ Available Rules
Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'equalToField', 'other_field_name');
{% endhighlight %}

- `equalToValue`: Validate the value as loosely equal to a specified value.
Sanitize to the specified value. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'equalToValue', $other_value);
{% endhighlight %}

Expand All @@ -242,20 +251,23 @@ Available Rules
expect. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'float');
{% endhighlight %}

- `inKeys`: Validate that the value is loosely equal to a key in a given
array. The value cannot be sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'inKeys', $array);
{% endhighlight %}

- `inValues`: Validate that the value is strictly equal to at least one value
in a given array. The value cannot be sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'inValues', $array);
{% endhighlight %}

Expand All @@ -264,13 +276,15 @@ Available Rules
expect. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'int');
{% endhighlight %}

- `ipv4`: Validate the value as an IPv4 address. The value cannot be
sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'ipv4');
{% endhighlight %}

Expand All @@ -279,6 +293,7 @@ Available Rules
Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'max', $max);
{% endhighlight %}

Expand All @@ -287,13 +302,15 @@ Available Rules
miniumum.Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'min', $min);
{% endhighlight %}

- `regex`: Validate the value using `preg_match()`. Sanitize the value using
`preg_replace()`.

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'regex', $expr);
{% endhighlight %}

Expand All @@ -302,13 +319,15 @@ Available Rules
Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strictEqualToField', 'other_field_name');
{% endhighlight %}

- `strictEqualToValue`: Validate the value as strictly equal to a specified
value. Sanitize to the specified value. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strictEqualToValue', $other_value);
{% endhighlight %}

Expand All @@ -317,13 +336,15 @@ Available Rules
(note that this is to sanitize, not validate):

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::FIX, 'string', $find, $replace);
{% endhighlight %}

- `strlen`: Validate the value has a specified length. Sanitize the value
to cut off longer values at the right, and `str_pad()` shorter ones. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strlen', $len);
{% endhighlight %}

Expand All @@ -333,48 +354,55 @@ Available Rules
Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strlenBetween', $min, $max);
{% endhighlight %}

- `strlenMax`: Validate the value length as being no longer than a maximum.
Sanitize the value to cut off values longer than the maximum. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strlenMax', $max);
{% endhighlight %}

- `strlenMin`: Validate the value length as being no shorter than a minimum.
Sanitize the value to `str_pad()` values shorter than the minimum. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'strlenMin', $min);
{% endhighlight %}

- `trim`: Validate the value is `trim()`med. Sanitize the value to `trim()` it.
Optionally specify characters to trim. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'trim', $chars);
{% endhighlight %}

- `upload`: Validate the value represents a PHP upload information array, and
that the file is an uploaded file. The value cannot be sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'upload');
{% endhighlight %}

- `url`: Validate the value is a well-formed URL. The value cannot be
sanitized. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'url');
{% endhighlight %}

- `word`: Validate the value as being composed only of word characters.
Sanitize the value to remove non-word characters. Usage:

{% highlight php %}
<?php
$filter->addSoftRule('field', $filter::IS, 'word');
{% endhighlight %}

Expand Down

1 comment on commit 745b2b8

@harikt
Copy link
Member Author

@harikt harikt commented on 745b2b8 Dec 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this gh-pages fails , I can revert back . Currently I didn't noticed a failure message , nor a success message . Running in local jekyll doesn't throw any error either .

Please sign in to comment.