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

View - setRenderLevel() parsing layout on LEVEL_NO_RENDER #76

Closed
niden opened this issue Sep 11, 2012 · 4 comments
Closed

View - setRenderLevel() parsing layout on LEVEL_NO_RENDER #76

niden opened this issue Sep 11, 2012 · 4 comments
Milestone

Comments

@niden
Copy link
Member

niden commented Sep 11, 2012

From Google Groups:

Sooperagile Agile

Guys, Even if one sets Render Level to $this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_NO_RENDER); main layout is still parsed

@phalcon
Copy link
Collaborator

phalcon commented Sep 12, 2012

Hello Agile,

I'm not able to reproduce your problem. I added an action to the MVC example with a main view:

https://github.com/phalcon/mvc/blob/master/single/apps/controllers/ProductsController.php
https://github.com/phalcon/mvc/blob/master/single/apps/views/index.phtml

Accesing the "/products/test" isn't producing the output in the main view.

Check the following urls:
http://test.phalconphp.com/single/products/index -> show the output in the main view
http://test.phalconphp.com/single/products/test -> doesn't show anything

Also, we added a unit test to test that render level:

https://github.com/phalcon/cphalcon/blob/0.5.0/unit-tests/ViewTest.php#L96

@phalcon
Copy link
Collaborator

phalcon commented Sep 12, 2012

Closing issue because this isn't a bug. Thanks

@phalcon phalcon closed this as completed Sep 12, 2012
@lantian
Copy link
Contributor

lantian commented Apr 19, 2013

it seems that this problem still present, but only with volt engine, it does not listen this:

$view->disableLevel(array(
                    \Phalcon\Mvc\View::LEVEL_ACTION_VIEW,
                    \Phalcon\Mvc\View::LEVEL_AFTER_TEMPLATE,
                    \Phalcon\Mvc\View::LEVEL_BEFORE_TEMPLATE,
                    \Phalcon\Mvc\View::LEVEL_LAYOUT,
                    \Phalcon\Mvc\View::LEVEL_MAIN_LAYOUT,
            ));

(or any of them)

and this:

$view->setLayout('widget');

(can't change layout with this function, only by 'extends' in view)

@lantian
Copy link
Contributor

lantian commented Apr 19, 2013

No, it works, sorry, but not everywhere i will try to investigate this...

phalcon pushed a commit that referenced this issue Oct 15, 2013
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