<commit_before>###########
View Parser
###########

.. contents::
    :local:
    :depth: 2

The View Parser can perform simple text substitution for
pseudo-variables contained within your view files.
It can parse simple variables or variable tag pairs.

Pseudo-variable names or control constructs are enclosed in braces, like this::

    <html>
    <head>
        <title>{blog_title}</title>
    </head>
    <body>
        <h3>{blog_heading}</h3>

        {blog_entries}
            <h5>{title}</h5>
            <p>{body}</p>
        {/blog_entries}

    </body>
    </html>

These variables are not actual PHP variables, but rather plain text
representations that allow you to eliminate PHP from your templates
(view files).

.. note:: CodeIgniter does **not** require you to use this class since
    using pure PHP in your view pages (for instance using the
    :doc:`View renderer </outgoing/view_renderer>` )
    lets them run a little faster.
    However, some developers prefer to use some form of template engine if
    they work with designers who they feel would find some
    confusion working with PHP.

***************************
Using the View Parser Class
***************************

The simplest method to load the parser class is through its service:

.. literalinclude:: view_parser/001.php

Alternately, if you are not using the ``Parser`` class as your default renderer, you
can instantiate it directly:

.. literalinclude:: view_parser/002.php

Then you can use any of the three standard rendering methods that it provides:
``render()``, ``setVar()`` and
``setData()``. You will also be able to specify delimiters directly,
through the ``setDelimiters()`` method.

Using the ``Parser``, your view templates are processed only by the Parser
itself, and not like a conventional view PHP script. PHP code in such a script
is ignored by the parser, and only substitutions are performed.

This is purposeful: view files with no PHP.

What It Does
============

The ``Parser`` class processes "PHP/HTML scripts" stored in the application's view path.
These scripts can not contain any PHP.
<commit_msg>docs: make text as a important note<commit_after>###########
View Parser
###########

.. contents::
    :local:
    :depth: 2

The View Parser can perform simple text substitution for
pseudo-variables contained within your view files.
It can parse simple variables or variable tag pairs.

Pseudo-variable names or control constructs are enclosed in braces, like this::

    <html>
    <head>
        <title>{blog_title}</title>
    </head>
    <body>
        <h3>{blog_heading}</h3>

        {blog_entries}
            <h5>{title}</h5>
            <p>{body}</p>
        {/blog_entries}

    </body>
    </html>

These variables are not actual PHP variables, but rather plain text
representations that allow you to eliminate PHP from your templates
(view files).

.. note:: CodeIgniter does **not** require you to use this class since
    using pure PHP in your view pages (for instance using the
    :doc:`View renderer </outgoing/view_renderer>` )
    lets them run a little faster.
    However, some developers prefer to use some form of template engine if
    they work with designers who they feel would find some
    confusion working with PHP.

***************************
Using the View Parser Class
***************************

The simplest method to load the parser class is through its service:

.. literalinclude:: view_parser/001.php

Alternately, if you are not using the ``Parser`` class as your default renderer, you
can instantiate it directly:

.. literalinclude:: view_parser/002.php

Then you can use any of the three standard rendering methods that it provides:
``render()``, ``setVar()`` and
``setData()``. You will also be able to specify delimiters directly,
through the ``setDelimiters()`` method.

.. important:: Using the ``Parser``, your view templates are processed only by the Parser
    itself, and not like a conventional view PHP script. PHP code in such a script
    is ignored by the parser, and only substitutions are performed.

    This is purposeful: view files with no PHP.

What It Does
============

The ``Parser`` class processes "PHP/HTML scripts" stored in the application's view path.
These scripts can not contain any PHP.

{'fraction_non_alphanumeric': 0.11727675448822569, 'fraction_numerical': 0.005129400792725577, 'mean_word_length': 3.678298800436205, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7312521', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1106, 'n_words': 549}