mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 12:37:15 +00:00
Merge branch '1.x' into 2.x
* 1.x: use HTTPS whenever possible
This commit is contained in:
+2
-2
@@ -530,7 +530,7 @@ to host all the specific tags and filters you want to add to Twig.
|
||||
.. note::
|
||||
|
||||
Before writing your own extensions, have a look at the Twig official
|
||||
extension repository: http://github.com/twigphp/Twig-extensions.
|
||||
extension repository: https://github.com/twigphp/Twig-extensions.
|
||||
|
||||
An extension is a class that implements the following interface::
|
||||
|
||||
@@ -912,6 +912,6 @@ Testing the node visitors can be complex, so extend your test cases from
|
||||
``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
|
||||
`tests/Twig/Node`_ directory.
|
||||
|
||||
.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
|
||||
.. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php
|
||||
.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Fixtures
|
||||
.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/2.x/test/Twig/Tests/Node
|
||||
|
||||
+1
-1
@@ -15,4 +15,4 @@ The ``abs`` filter returns the absolute value.
|
||||
|
||||
Internally, Twig uses the PHP `abs`_ function.
|
||||
|
||||
.. _`abs`: http://php.net/abs
|
||||
.. _`abs`: https://secure.php.net/abs
|
||||
|
||||
@@ -19,4 +19,4 @@ Arguments
|
||||
* ``to``: The output charset
|
||||
* ``from``: The input charset
|
||||
|
||||
.. _`iconv`: http://php.net/iconv
|
||||
.. _`iconv`: https://secure.php.net/iconv
|
||||
|
||||
@@ -75,8 +75,8 @@ Arguments
|
||||
* ``format``: The date format
|
||||
* ``timezone``: The date timezone
|
||||
|
||||
.. _`strtotime`: http://www.php.net/strtotime
|
||||
.. _`DateTime`: http://www.php.net/DateTime
|
||||
.. _`DateInterval`: http://www.php.net/DateInterval
|
||||
.. _`date`: http://www.php.net/date
|
||||
.. _`DateInterval::format`: http://www.php.net/DateInterval.format
|
||||
.. _`strtotime`: https://secure.php.net/strtotime
|
||||
.. _`DateTime`: https://secure.php.net/DateTime
|
||||
.. _`DateInterval`: https://secure.php.net/DateInterval
|
||||
.. _`date`: https://secure.php.net/date
|
||||
.. _`DateInterval::format`: https://secure.php.net/DateInterval.format
|
||||
|
||||
@@ -16,5 +16,5 @@ Arguments
|
||||
|
||||
* ``modifier``: The modifier
|
||||
|
||||
.. _`strtotime`: http://www.php.net/strtotime
|
||||
.. _`DateTime`: http://www.php.net/DateTime
|
||||
.. _`strtotime`: https://secure.php.net/strtotime
|
||||
.. _`DateTime`: https://secure.php.net/DateTime
|
||||
|
||||
@@ -106,4 +106,4 @@ Arguments
|
||||
* ``strategy``: The escaping strategy
|
||||
* ``charset``: The string charset
|
||||
|
||||
.. _`htmlspecialchars`: http://php.net/htmlspecialchars
|
||||
.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars
|
||||
|
||||
@@ -19,4 +19,4 @@ a string:
|
||||
|
||||
It also works with objects implementing the `Traversable`_ interface.
|
||||
|
||||
.. _`Traversable`: http://php.net/manual/en/class.traversable.php
|
||||
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
|
||||
|
||||
@@ -11,6 +11,6 @@ The ``format`` filter formats a given string by replacing the placeholders
|
||||
{# outputs I like foo and bar
|
||||
if the foo parameter equals to the foo string. #}
|
||||
|
||||
.. _`sprintf`: http://www.php.net/sprintf
|
||||
.. _`sprintf`: https://secure.php.net/sprintf
|
||||
|
||||
.. seealso:: :doc:`replace<replace>`
|
||||
|
||||
@@ -17,5 +17,5 @@ Arguments
|
||||
* ``options``: A bitmask of `json_encode options`_ (``{{
|
||||
data|json_encode(constant('JSON_PRETTY_PRINT')) }}``)
|
||||
|
||||
.. _`json_encode`: http://php.net/json_encode
|
||||
.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php
|
||||
.. _`json_encode`: https://secure.php.net/json_encode
|
||||
.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php
|
||||
|
||||
@@ -19,4 +19,4 @@ a string:
|
||||
|
||||
It also works with objects implementing the `Traversable`_ interface.
|
||||
|
||||
.. _`Traversable`: http://php.net/manual/en/class.traversable.php
|
||||
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
|
||||
|
||||
@@ -45,4 +45,4 @@ overridden.
|
||||
Internally, Twig uses the PHP `array_merge`_ function. It supports
|
||||
Traversable objects by transforming those to arrays.
|
||||
|
||||
.. _`array_merge`: http://php.net/array_merge
|
||||
.. _`array_merge`: https://secure.php.net/array_merge
|
||||
|
||||
@@ -47,4 +47,4 @@ Arguments
|
||||
* ``decimal_point``: The character(s) to use for the decimal point
|
||||
* ``thousand_sep``: The character(s) to use for the thousands separator
|
||||
|
||||
.. _`number_format`: http://php.net/number_format
|
||||
.. _`number_format`: https://secure.php.net/number_format
|
||||
|
||||
@@ -41,4 +41,4 @@ Arguments
|
||||
|
||||
* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.
|
||||
|
||||
.. _`Traversable`: http://php.net/Traversable
|
||||
.. _`Traversable`: https://secure.php.net/Traversable
|
||||
|
||||
@@ -62,7 +62,7 @@ Arguments
|
||||
* ``length``: The size of the slice
|
||||
* ``preserve_keys``: Whether to preserve key or not (when the input is an array)
|
||||
|
||||
.. _`Traversable`: http://php.net/manual/en/class.traversable.php
|
||||
.. _`array_slice`: http://php.net/array_slice
|
||||
.. _`mb_substr` : http://php.net/mb-substr
|
||||
.. _`substr`: http://php.net/substr
|
||||
.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
|
||||
.. _`array_slice`: https://secure.php.net/array_slice
|
||||
.. _`mb_substr` : https://secure.php.net/mb-substr
|
||||
.. _`substr`: https://secure.php.net/substr
|
||||
|
||||
@@ -15,4 +15,4 @@ The ``sort`` filter sorts an array:
|
||||
association. It supports Traversable objects by transforming
|
||||
those to arrays.
|
||||
|
||||
.. _`asort`: http://php.net/asort
|
||||
.. _`asort`: https://secure.php.net/asort
|
||||
|
||||
@@ -46,5 +46,5 @@ Arguments
|
||||
* ``delimiter``: The delimiter
|
||||
* ``limit``: The limit argument
|
||||
|
||||
.. _`explode`: http://php.net/explode
|
||||
.. _`str_split`: http://php.net/str_split
|
||||
.. _`explode`: https://secure.php.net/explode
|
||||
.. _`str_split`: https://secure.php.net/str_split
|
||||
|
||||
@@ -26,4 +26,4 @@ Arguments
|
||||
|
||||
* ``allowable_tags``: Tags which should not be stripped
|
||||
|
||||
.. _`strip_tags`: http://php.net/strip_tags
|
||||
.. _`strip_tags`: https://secure.php.net/strip_tags
|
||||
|
||||
@@ -34,6 +34,6 @@ Arguments
|
||||
* ``side``: The default is to strip from the left and the right (`both`) sides, but `left`
|
||||
and `right` will strip from either the left side or right side only
|
||||
|
||||
.. _`trim`: http://php.net/trim
|
||||
.. _`ltrim`: http://php.net/ltrim
|
||||
.. _`rtrim`: http://php.net/rtrim
|
||||
.. _`trim`: https://secure.php.net/trim
|
||||
.. _`ltrim`: https://secure.php.net/ltrim
|
||||
.. _`rtrim`: https://secure.php.net/rtrim
|
||||
|
||||
@@ -19,4 +19,4 @@ or an array as query string:
|
||||
|
||||
Internally, Twig uses the PHP ``rawurlencode``.
|
||||
|
||||
.. _`rawurlencode`: http://php.net/rawurlencode
|
||||
.. _`rawurlencode`: https://secure.php.net/rawurlencode
|
||||
|
||||
@@ -43,4 +43,4 @@ Arguments
|
||||
* ``date``: The date
|
||||
* ``timezone``: The timezone
|
||||
|
||||
.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php
|
||||
.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php
|
||||
|
||||
@@ -62,5 +62,5 @@ Arguments
|
||||
|
||||
* ``context``: The context to dump
|
||||
|
||||
.. _`XDebug`: http://xdebug.org/docs/display
|
||||
.. _`var_dump`: http://php.net/var_dump
|
||||
.. _`XDebug`: https://xdebug.org/docs/display
|
||||
.. _`var_dump`: https://secure.php.net/var_dump
|
||||
|
||||
@@ -20,4 +20,4 @@ Arguments
|
||||
|
||||
* ``values``: The values
|
||||
|
||||
.. _`mt_rand`: http://php.net/mt_rand
|
||||
.. _`mt_rand`: https://secure.php.net/mt_rand
|
||||
|
||||
@@ -55,4 +55,4 @@ Arguments
|
||||
* ``high``: The highest possible value of the sequence.
|
||||
* ``step``: The increment between elements of the sequence.
|
||||
|
||||
.. _`range`: http://php.net/range
|
||||
.. _`range`: https://secure.php.net/range
|
||||
|
||||
@@ -7,4 +7,4 @@ Install `Composer`_ and run the following command to get the latest version:
|
||||
|
||||
composer require "twig/twig:^2.0"
|
||||
|
||||
.. _`Composer`: https://getcomposer.org/download/
|
||||
.. _`Composer`: https://getcomposer.org/download/
|
||||
|
||||
+2
-2
@@ -147,7 +147,7 @@ parent's full, unambiguous template path in the extends tag:
|
||||
.. note::
|
||||
|
||||
This recipe was inspired by the following Django wiki page:
|
||||
http://code.djangoproject.com/wiki/ExtendingTemplates
|
||||
https://code.djangoproject.com/wiki/ExtendingTemplates
|
||||
|
||||
Customizing the Syntax
|
||||
----------------------
|
||||
@@ -524,4 +524,4 @@ include in your templates:
|
||||
'tag_variable' => array('{[', ']}'),
|
||||
)));
|
||||
|
||||
.. _callback: http://www.php.net/manual/en/function.is-callable.php
|
||||
.. _callback: https://secure.php.net/manual/en/function.is-callable.php
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ The ``flush`` tag tells Twig to flush the output buffer:
|
||||
|
||||
Internally, Twig uses the PHP `flush`_ function.
|
||||
|
||||
.. _`flush`: http://php.net/flush
|
||||
.. _`flush`: https://secure.php.net/flush
|
||||
|
||||
+3
-3
@@ -879,12 +879,12 @@ Extension<creating_extensions>` chapter.
|
||||
.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig
|
||||
.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin
|
||||
.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language
|
||||
.. _`extension repository`: http://github.com/twigphp/Twig-extensions
|
||||
.. _`extension repository`: https://github.com/twigphp/Twig-extensions
|
||||
.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode
|
||||
.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode
|
||||
.. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig
|
||||
.. _`web-mode.el`: http://web-mode.org/
|
||||
.. _`regular expressions`: http://php.net/manual/en/pcre.pattern.php
|
||||
.. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php
|
||||
.. _`PHP-twig for atom`: https://github.com/reesef/php-twig
|
||||
.. _`TwigFiddle`: http://twigfiddle.com/
|
||||
.. _`TwigFiddle`: https://twigfiddle.com/
|
||||
.. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*
|
||||
* This parser implements a "Precedence climbing" algorithm.
|
||||
*
|
||||
* @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
|
||||
* @see http://en.wikipedia.org/wiki/Operator-precedence_parser
|
||||
* @see https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
|
||||
* @see https://en.wikipedia.org/wiki/Operator-precedence_parser
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
|
||||
@@ -908,7 +908,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
||||
|
||||
switch ($strategy) {
|
||||
case 'html':
|
||||
// see http://php.net/htmlspecialchars
|
||||
// see https://secure.php.net/htmlspecialchars
|
||||
|
||||
// Using a static variable to avoid initializing the array
|
||||
// each time the function is called. Moving the declaration on the
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* {% endsandbox %}
|
||||
* </pre>
|
||||
*
|
||||
* @see http://www.twig-project.org/doc/api.html#sandbox-extension for details
|
||||
* @see https://twig.symfony.com/doc/api.html#sandbox-extension for details
|
||||
*/
|
||||
final class Twig_TokenParser_Sandbox extends Twig_TokenParser
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* {% block content %}{% endblock %}
|
||||
* </pre>
|
||||
*
|
||||
* @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details.
|
||||
* @see https://twig.symfony.com/doc/templates.html#horizontal-reuse for details.
|
||||
*/
|
||||
final class Twig_TokenParser_Use extends Twig_TokenParser
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/**
|
||||
* This class is adapted from code coming from Zend Framework.
|
||||
*
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user