Giter Site home page Giter Site logo

auraphp / aura.view Goto Github PK

View Code? Open in Web Editor NEW
86.0 14.0 21.0 686 KB

Provides TemplateView and TwoStepView using PHP as the templating language, with support for partials, sections, and helpers.

License: BSD 2-Clause "Simplified" License

PHP 99.97% Hack 0.03%
aura view template partials php

aura.view's Introduction

Aura View

This package provides an implementation of the TemplateView and TwoStepView patterns using PHP itself as the templating language. It supports both file-based and closure-based templates along with helpers and sections.

It is preceded by systems such as Savant, Zend_View, and Solar_View.

Foreword

Installation

This library requires PHP 5.4 or later; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.

It is installable and autoloadable via Composer as aura/view.

Alternatively, download a release or clone this repository, then require or include its autoload.php file.

Quality

Scrutinizer Code Quality codecov Continuous Integration

To run the unit tests at the command line, issue composer install and then ./vendor/bin/phpunit at the package root. This requires Composer to be available as composer.

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Community

To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our Google Group, follow @auraphp on Twitter, or chat with us on #auraphp on Freenode.

Getting Started

Instantiation

To instantiate a View object, use the ViewFactory:

<?php
$view_factory = new \Aura\View\ViewFactory;
$view = $view_factory->newInstance();
?>

Escaping Output

Security-minded observers will note that all the examples in this document use manually-escaped output. Because this package is not specific to any particular media type, it does not come with escaping functionality.

When you generate output via templates, you must escape it appropriately for security purposes. This means that HTML templates should use HTML escaping, CSS templates should use CSS escaping, XML templates should use XML escaping, PDF templates should use PDF escaping, RTF templates should use RTF escaping, and so on.

For a good set of HTML escapers, please consider Aura.Html.

Registering View Templates

Now that we have a View, we need to add named templates to its view template registry. These are typically PHP file paths, but templates can also be closures. For example:

<?php
$view_registry = $view->getViewRegistry();
$view_registry->set('browse', '/path/to/views/browse.php');
?>

The browse.php file may look something like this:

<?php
foreach ($this->items as $item) {
    $id = htmlspecialchars($item['id'], ENT_QUOTES, 'UTF-8');
    $name = htmlspecialchars($item['name'], ENT_QUOTES, 'UTF-8');
    echo "Item ID #{$id} is '{$name}'." . PHP_EOL;
}
?>

Note that we use echo, and not return, in templates.

N.b.: The template logic will be executed inside the View object scope, which means that $this in the template code will refer to the View object. The same is true for closure-based templates.

Setting Data

We will almost always want to use dynamic data in our templates. To assign a data collection to the View, use the setData() method and either an array or an object. We can then use data elements as if they are properties on the View object.

<?php
$view->setData(array(
    'items' => array(
        array(
            'id' => '1',
            'name' => 'Foo',
        ),
        array(
            'id' => '2',
            'name' => 'Bar',
        ),
        array(
            'id' => '3',
            'name' => 'Baz',
        ),
    )
));
?>

N.b.: Recall that $this in the template logic refers to the View object, so that data assigned to the View can be accessed as properties on $this.

The setData() method will overwrite all existing data in the View object. The addData() method, on the other hand, will merge with existing data in the View object.

Invoking A One-Step View

Now that we have registered a template and assigned some data to the View, we tell the View which template to use, and then invoke the View:

<?php
$view->setView('browse');
$output = $view->__invoke(); // or just $view()
?>

The $output in this case will be something like this:

Item #1 is 'Foo'.
Item #2 is 'Bar'.
Item #3 is 'Baz'.

Using Sub-Templates (aka "Partials")

Sometimes we will want to split a template up into multiple pieces. We can render these "partial" template pieces using the render() method in our main template code.

First, we place the sub-template in the view registry (or in the layout registry if it for use in layouts). Then we render() it from inside the main template code. Sub-templates can use any naming scheme we like. Some systems use the convention of prefixing partial templates with an underscore, and the following example will use that convention.

Second, we can pass an array of variables to be extracted into the local scope of the partial template. (The $this variable will always be available regardless.)

For example, let's split up our browse.php template file so that it uses a sub-template for displaying items.

<?php
// add templates to the view registry
$view_registry = $view->getViewRegistry();

// the "main" template
$view_registry->set('browse', '/path/to/views/browse.php');

// the "sub" template
$view_registry->set('_item', '/path/to/views/_item.php');
?>

We extract the item-display code from browse.php into _item.php:

<?php
$id = htmlspecialchars($item['id'], ENT_QUOTES, 'UTF-8');
$name = htmlspecialchars($item['name'], ENT_QUOTES, 'UTF-8')
echo "Item ID #{$id} is '{$name}'." . PHP_EOL;
?>

Then we modify browse.php to use the sub-template:

<?php
foreach ($this->items as $item) {
    echo $this->render('_item', array(
        'item' => $item,
    ));
?>

The output will be the same as earlier when we invoke the view.

N.b.: Alternatively, we can use include or require to execute a PHP file directly in the current template scope.

Using Sections

Sections are similar to sub-templates (aka "partials") except that they are captured inline for later use. In general, they are used by view templates to capture output for layout templates.

For example, we can capture output in the view template to a named section ...

<?php
// begin buffering output for a named section
$this->beginSection('local-nav');

echo "<div>";
// ... echo the local navigation output ...
echo "</div>";

// end buffering and capture the output
$this->endSection();
?>

... and then use that output in a layout template:

<?php
if ($this->hasSection('local-nav')) {
    echo $this->getSection('local-nav');
} else {
    echo "<div>No local navigation.</div>";
}
?>

In addition, the setSection() method can be used to set the section body directly, instead of capturing it:

<?php
$this->setSection('local-nav', $this->render('_local-nav'));
?>

Using Helpers

The ViewFactory instantiates the View with an empty HelperRegistry to manage helpers. We can register closures or other invokable objects as helpers through the HelperRegistry. We can then call these helpers as if they are methods on the View.

<?php
$helpers = $view->getHelpers();
$helpers->set('hello', function ($name) {
    return "Hello {$name}!";
});

$view_registry = $view->getViewRegistry();
$view_registry->set('index', function () {
    echo $this->hello('World');
});

$view->setView('index');
$output = $view();
?>

This library does not come with any view helpers. You will need to add your own helpers to the registry as closures or invokable objects.

Custom Helper Managers

The View is not type-hinted to any particular class for its helper manager. This means you may inject an arbitrary object of your own at View construction time to manage helpers. To do so, pass a helper manager of your own to the ViewFactory.

<?php
class OtherHelperManager
{
    public function __call($helper_name, $args)
    {
        // logic to call $helper_name with
        // $args and return the result
    }
}

$helpers = new OtherHelperManager;
$view = $view_factory->newInstance($helpers);
?>

For a comprehensive set of HTML helpers, including form and input helpers, please consider the Aura.Html package and its HelperLocator as an alternative to the HelperRegistry in this package. You can pass it to the ViewFactory like so:

<?php
$helpers_factory = new Aura\Html\HelperLocatorFactory;
$helpers = $helpers_factory->newInstance();
$view = $view_factory->newInstance($helpers);
?>

Rendering a Two-Step View

To wrap the main content in a layout as part of a two-step view, we register layout templates with the View and then call setLayout() to pick one of them for the second step. (If no layout is set, the second step will not be executed.)

Let's say we have already set the browse template above into our view registry. We then set a layout template called default into the layout registry:

<?php
$layout_registry = $view->getLayoutRegistry();
$layout_registry->set('default', '/path/to/layouts/default.php');
?>

The default.php layout template might look like this:

<html>
<head>
    <title>My Site</title>
</head>
<body>
<?= $this->getContent(); ?>
</body>
</html>

We can then set the view and layout templates on the View object and then invoke it:

<?php
$view->setView('browse');
$view->setLayout('default');
$output = $view->__invoke(); // or just $view()
?>

The output from the inner view template is automatically retained and becomes available via the getContent() method on the View object. The layout template then calls getContent() to place the inner view results in the outer layout template.

N.b. We can also call setLayout() from inside the view template, allowing us to pick a layout as part of the view logic.

The view template and the layout template both execute inside the same View object. This means:

  • All data values are shared between the view and the layout. Any data assigned to the view, or modified by the view, is used as-is by the layout.

  • All helpers are shared between the view and the layout. This sharing situation allows the view to modify data and helpers before the layout is executed.

  • All section bodies are shared between the view and the layout. A section that is captured from the view template can therefore be used by the layout template.

Closures As Templates

The view and layout registries accept closures as templates. For example, these are closure-based equivlents of the browse.php and _item.php template files above:

<?php
$view_registry->set('browse', function () {
    foreach ($this->items as $item) {
        echo $this->render('_item', array(
            'item' => $item,
        ));
    }
);

$view_registry->set('_item', function (array $vars) {
    extract($vars, EXTR_SKIP);
    $id = htmlspecialchars($item['id'], ENT_QUOTES, 'UTF-8');
    $name = htmlspecialchars($item['name'], ENT_QUOTES, 'UTF-8')
    echo "Item ID #{$id} is '{$name}'." . PHP_EOL;
);
?>

When registering a closure-based template, continue to use echo instead of return when generating output. The closure is rebound to the View object, so $this in the closure will refer to the View just as it does in a file-based template.

A bit of extra effort is required with closure-based sub-templates (aka "partials"). Whereas file-based templates automatically extract the passed array of variables into the local scope, a closure-based template must:

  1. Define a function parameter to receive the injected variables (the $vars param in the _item template); and,

  2. Extract the injected variables using extract(). Alternatively, the closure may use the injected variables parameter directly.

Aside from that, closure-based templates work exactly like file-based templates.

Registering Template Search Paths

We can also tell the view and layout registries to search the filesystem for templates. First, we tell the registry what directories contain template files:

<?php
$view_registry = $view->getViewRegistry();
$view_registry->setPaths(array(
    '/path/to/foo',
    '/path/to/bar',
    '/path/to/baz'
));
?>

When we refer to named templates later, the registry will search from the first directory to the last. For finer control over the search paths, we can call prependPath() to add a directory to search earlier, or appendPath() to add a directory to search later. Regardless, the View will auto-append .php to the end of template names when searching through the directories.

Template Namespaces

We can also add namespaced templates which we can refer to with the syntax namespace::template. We can add directories that correspond to namespaces:

<?php
$view_registry = $view->getViewRegistry();
$view_registry->appendPath('/path/to/templates', 'my-namespace');

$view->setView('my-namespace::browse');

When we refer to namespaced templates, only the paths associated with that namespace will be searched.

Changing The Template File Extension

By default, each TemplateRegistry will auto-append .php to template file names. If the template files end with a different extension, change it using the setTemplateFileExtension() method:

<?php
$view_registry = $view->getViewRegistry();
$view_registry->setTemplateFileExtension('.phtml');
?>

The TemplateRegistry instance used for the layouts is separate from the one for the views, so it may be necessary to change the template file extension on it as well:

<?php
$layout_registry = $view->getLayoutRegistry();
$layout_registry->setTemplateFileExtension('.phtml');
?>

Advanced Configuration

Alternatively you can pass $helpers, mapping information or paths for views and layouts as below.

<?php
$view_factory = new \Aura\View\ViewFactory;
$view = $view_factory->newInstance(
    $helpers = null,
    [
        'browse' => '/path/to/views/browse.php'
    ],
    [
        '/path/to/views/welcome',
        '/path/to/views/user',
    ],
    [
        'layout' => '/path/to/layouts/default.php'
    ],
    [
        '/path/to/layouts',
    ],
);
?>

If you are passing the mapping information or paths to views and layouts you don't need to call the getViewRegistry or getLayoutRegistry and set the mapping information.

Eg :

$view_registry = $view->getViewRegistry();
$view_registry->set('browse', '/path/to/views/browse.php');

$layout_registry = $view->getLayoutRegistry();
$layout_registry->set('default', '/path/to/layouts/default.php');

aura.view's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aura.view's Issues

Consistency accross Aura.Html and Aura.View

Hi @pmjones ,

I noticed the name for escaping in Aura.Html is safeHtml , but in Aura.View , the Helper\EscapeHtml not added.

The name probably would be going as escapeHtml .

What are your thoughts on the same ?

Helpers methods chaining

It would be nice if Helper's methods were chaining, like the Title helper, the append(), prepend() methods could return $this.

What do you think?

Typo on the github description

using PHP as the tempting language

Should be templating language... unless there's some new tempting technology I'm not aware of.

Solved: Static class and Template Closure problem

Hi,

I'm using Aura.View in a class with static methods (read as Singleton). On set() method, I encountered a scoping problem, it would throw: "Cannot bind an instance to a static closure".

Mentioned line would read:

protected static function initializeView($name, $view) {
...
   return static::_getRegistry()->set('rawContent', function() use($content) {
       echo $content;
   });
...
}

It turned out the Closure was automatically taking static as its scope and this was problematic in AbstractView::getTemplate() method.

This is how I solved it out:

class RawContent {
    public function getClosure($view) {
        return function() use($view) {
            echo $view;
        };
    }
}
$closure = new RawContent();
return static::_getRegistry()->set('rawContent', $closure->getClosure($view));

Now our indirect closure in getClosure method will have a $this scope and not a static scope as the second part of the code has.

Could you include a demo project/big picture in these repos?

When learning both aura.router and aura.view, it took me seeing somebody else's code before the entire picture clicked and I was able to understand how the libraries worked. Any chance you guys could include some sort of sample code in these repos? Maybe it's just me, but when just reading the instructions, I had trouble grasping exactly what was going on until I saw some tutorials detailing the entire process.

May be an init method

If Aura.View have an init method may be good to make use of it for people who need to do something after contruction. See pmjones/adr#17 . In the example I am trying to extend the Aura\View\View to set the layout and view.

Error in Partial

I have created a partial when playing with Aura.Framework in develop branch.

The view script it

echo $this->fetch('code', [
    'controller_code' => $this->controller_code,
    'file_name' => 'hello',
]);

And in the partial I tried $controller_code and $file_name . It throws errors . So I changed to $this->controller_code . You can notice the controller_code is assigned from controller and it works as expected . But the remaining fails.

<div>
    <p class="text-info">The Controller code that does this :) </p>
    <pre class="pre-scrollable"><?= $this->controller_code; ?></pre>
    <p class="text-info">The view <?= $this->file_name; ?></p>
</div>

Escaper Branch , inner view escaped twice?

render() method calls renderInnerView() and renderOuterView($inner) . The renderInnerView() calls setData() and is escaped once. Then the inner data contains the html data . Then renderOuterView($inner) again escapes the html also .

So I feel data will be escaped twice and the inner view html contents also escaped .

Possible bug with the aura closure view

Hi Paul,

I was just playing around to learn and implement ADR in aura. See https://github.com/harikt/adr/commit/f7f79e898d182c4fb9e0222044b9d1224e3498ad

In that I was writing a test on the render functionality done with aura/view. I am seeing something like

PHPUnit 4.0.13 by Sebastian Bergmann.

Configuration read from /var/www/adr/tests/phpunit.xml

E.

Time: 30 ms, Memory: 3.75Mb

There was 1 error:

1) Aura\Action_Bundle\AuraViewTest::testRenderHello
Missing argument 1 for Aura\View\View::Aura\Action_Bundle\{closure}()

/var/www/adr/tests/src/AuraViewTest.php:17
/var/www/adr/vendor/aura/view/src/View.php:58
/var/www/adr/vendor/aura/view/src/View.php:58
/var/www/adr/vendor/aura/view/src/View.php:32
/var/www/adr/src/AuraView.php:24
/var/www/adr/tests/src/AuraViewTest.php:38

FAILURES!
Tests: 2, Assertions: 1, Errors: 1.

This sounds to me that there is some sort of bug in the View.

Release?

2.2.1...2.x

@harikt added a useful way to pass layout/view maps/paths to the newInstance method in 07548bf some time ago, but I dont believe theres a release yet.

__construct() method, not __invoke() method, being called on helpers

I am creating custom helpers, and registering them with the HelperRegistry. These helpers are objects, and the object is instantiated using Aura.Di, thusly:

$di->params['Aura\View\HelperRegistry'] = [
    'map' => [
        'messages' => $di->lazyNew('Modus\Template\Helper\Messages'),
        'paginator' => $di->lazyNew('Modus\Template\Helper\Paginator'),
        'linkgenerator' => $di->lazyNew('Modus\Template\Helper\LinkGenerator'),
    ]
];

The problem is, when I use them in my views, the __construct() method is called, not the __invoke() method. Meaning that to call these methods, I must do the following:

<?php
$result = $this->linkgenerator();

echo $result('auth2');

?>

This isn't the way helpers used to work. The only way it seems to fix this issue is to create a closure, like so:

$di->params['Aura\View\HelperRegistry'] = [
    'map' => [
        'linkgenerator' => function($route) use ($di) {
            $obj = $di->newInstance('Modus\Template\Helper\LinkGenerator');
            return $obj($route);
        },
    ]
];

This is clearly sub-optimal. Also, there seems to be an issue whereby using $di->lazyNew() is a problem, as though lazyNew() itself is not callable.

getTemplate needs in TwoStep

I was looking how I can get the TemplateFinder object. And it seems we are not able to access the Template object.

Can we make a getTemplate method for TwoStepView ?

My idea of Repeat Field

Recently this was a problem I faced, probably it can be solved by some other way .

I have a Add button which can add as many fields. Let us say it is title, but it was really a group of fields.

When the user clicks on Add button I just added a text field with name as fieldname[] . This way I know the coming post value is an array for POST['fieldname'] .

This helps me to see how many are there and what I need to insert . Also I need to do the validation part . What I can do is count the number of values and pass it and via for loop I added for the fields.

But the base idea when edit also comes was we may want to remove a field from the middle , and not at the bottom . So if we use something like field1, field2, field3 etc , and say there are 10 fields. And I am going to remove the 5th and 7th one.

We may will worry which went off. But on the other way I can just remove all and just re-insert the values.

Indirect modification

Currently you cannot modify arrays that are set as view variables

$view->a = [];
$view->a[] = 1; // PHP Notice:  Indirect modification of overloaded property Aura/View/View::$a has no effect
var_dump($view->a); // empty array

is it a bug or expected behavior?

The fix is simple:
return field by reference

public function &__get($key)

I can make pr if you agree that it's a bug

Form component

So we are missing a form component.

Form at times is for view, but validation and processing at another end.

The most complicated one.

Whether we should include it as a view helper or

Multiple instance of Aura\View\Helper\Styles

There are multiple instances of Aura\View\Helper\Styles and I feel not just styles but almost all , and finally the styles array becoming null class Aura\View\Helper\Styles#266 (2) { protected $styles => array(0) { } protected $indent => string(4) " " }

I was looking into the changes of the config/default.php master...develop#L2R30

Aura View Helper not getting called :(

Paul ,

I moved the view helper SessionManager from framework to Hari.Sample . I also have merged all the develop stuffs pushed.

Now I am having a trouble . I am not able to get the SessionManager object. I feel its not calling invoke . Is it due to some changes in Aura.View ?

If you can please look into the https://github.com/harikt/Hari.Sample/blob/master/src/Hari/Sample/View/Helper/SessionManager.php

https://github.com/harikt/Hari.Sample/blob/master/config/default.php

to make the stuff not getting called from view

https://github.com/harikt/Hari.Sample/blob/master/src/Hari/Sample/Web/Post/views/add.php

It will be a great help if so.

Catchable fatal error: Object of class Hari\Sample\View\Helper\SessionManager could not be converted to string in /media/Linux/aurasystem/package/Hari.Sample/src/Hari/Sample/Web/Post/views/add.php on line 34 Call Stack: 0.0002 125932 1. {main}() /media/Linux/aurasystem/web/index.php:0 0.0006 155016 2. Aura\Framework\Bootstrap->execWeb() /media/Linux/aurasystem/web/index.php:11 0.0194 787772 3. Aura\Framework\Web\Controller\Front->exec() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Bootstrap.php:172 0.0195 788084 4. Aura\Framework\Web\Controller\Front->request() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:154 0.0310 1251752 5. Aura\Web\Controller\AbstractPage->exec() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:197 0.0320 1274300 6. Aura\Web\Controller\AbstractPage->render() /media/Linux/aurasystem/package/Aura.Web/src/Aura/Web/Controller/AbstractPage.php:135 0.0320 1274324 7. Aura\Framework\Web\Renderer\AuraViewTwoStep->exec() /media/Linux/aurasystem/package/Aura.Web/src/Aura/Web/Controller/AbstractPage.php:195 0.0324 1277180 8. Aura\View\TwoStep->render() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Renderer/AuraViewTwoStep.php:135 0.0324 1278248 9. Aura\View\TwoStep->renderView() /media/Linux/aurasystem/package/Aura.View/src/Aura/View/TwoStep.php:454 0.0325 1278448 10. Aura\View\Template->fetch() /media/Linux/aurasystem/package/Aura.View/src/Aura/View/TwoStep.php:495 0.0327 1301956 11. require('/media/Linux/aurasystem/package/Hari.Sample/src/Hari/Sample/Web/Post/views/add.php') /media/Linux/aurasystem/package/Aura.View/src/Aura/View/Template.php:35

Wondering whether we need to use __raw()

I have an array as

array(3) {
  [0] =>
  array(4) {
    'id' =>
    string(1) "1"
    'author_id' =>
    string(1) "1"
    'title' =>
    string(11) "Hello World"
    'body' =>
    string(11) "Hello World"
  }
  [1] =>
  array(4) {
    'id' =>
    string(1) "2"
    'author_id' =>
    string(1) "2"
    'title' =>
    string(14) "Sample title 2"
    'body' =>
    string(27) "Sample body for the title 1"
  }
  [2] =>
  array(4) {
    'id' =>
    string(1) "3"
    'author_id' =>
    string(1) "3"
    'title' =>
    string(14) "Sample title 3"
    'body' =>
    string(6) "body 3"
  }
}

passed to $this->data->posts from Aura.Framework Page controller.

Now when going with

<?php 
foreach( $this->posts as $post ) {
    echo $post['title'];
}; 
?>

Notice: Undefined property: ArrayObject::$title in /media/Linux/aurasystem/package/Aura.View/src/Aura/View/Escaper/Object.php on line 223

Call Stack:
    0.0000     124216   1. {main}() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Cli/Server/router.php:0
    0.0002     124988   2. require_once('/media/Linux/aurasystem/web/index.php') /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Cli/Server/router.php:36
    0.0002     127260   3. Aura\Framework\Bootstrap->execWeb() /media/Linux/aurasystem/web/index.php:11
    0.0111     423260   4. Aura\Framework\Web\Controller\Front->exec() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Bootstrap.php:172
    0.0112     423572   5. Aura\Framework\Web\Controller\Front->request() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:154
    0.0169     573456   6. Aura\Web\Controller\AbstractPage->exec() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Controller/Front.php:197
    0.0206     650612   7. Aura\Web\Controller\AbstractPage->render() /media/Linux/aurasystem/package/Aura.Web/src/Aura/Web/Controller/AbstractPage.php:135
    0.0206     650636   8. Aura\Framework\Web\Renderer\AuraViewTwoStep->exec() /media/Linux/aurasystem/package/Aura.Web/src/Aura/Web/Controller/AbstractPage.php:195
    0.0210     653480   9. Aura\View\TwoStep->render() /media/Linux/aurasystem/package/Aura.Framework/src/Aura/Framework/Web/Renderer/AuraViewTwoStep.php:135
    0.0210     654696  10. Aura\View\TwoStep->renderView() /media/Linux/aurasystem/package/Aura.View/src/Aura/View/TwoStep.php:454
    0.0211     654896  11. Aura\View\Template->fetch() /media/Linux/aurasystem/package/Aura.View/src/Aura/View/TwoStep.php:495
    0.0214     674400  12. require('/media/Linux/aurasystem/package/Hari.Sample/src/Hari/Sample/Web/Post/views/list.php') /media/Linux/aurasystem/package/Aura.View/src/Aura/View/Template.php:35
    0.0217     685760  13. Aura\View\Escaper\Object->offsetGet() /media/Linux/aurasystem/package/Aura.View/src/Aura/View/Template.php:4

NULL

Or do we need to iterate via $this->__raw()->posts ? If this is the way is there any use of escape ? Is it really escaping the inner data ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.