Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wondering whether we need to use __raw() #15

Closed
harikt opened this issue Oct 9, 2012 · 1 comment
Closed

Wondering whether we need to use __raw() #15

harikt opened this issue Oct 9, 2012 · 1 comment

Comments

@harikt
Copy link
Member

harikt commented Oct 9, 2012

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 ?

@pmjones
Copy link
Member

pmjones commented Oct 11, 2012

Definitely a problem. Working on it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants