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

[BUG] \Phalcon\Mvc\View - setLayout and pick #12273

Closed
tugrul opened this issue Sep 30, 2016 · 10 comments
Closed

[BUG] \Phalcon\Mvc\View - setLayout and pick #12273

tugrul opened this issue Sep 30, 2016 · 10 comments
Assignees
Labels
stale Stale issue - automatically closed

Comments

@tugrul
Copy link
Contributor

tugrul commented Sep 30, 2016

\Phalcon\Mvc\View::setLayout() has no effect when use with \Phalcon\Mvc\View::pick()

$view->setLayout('content/scope');
$view->pick('content/list');

Details

  • Phalcon version: 2.0.13
  • PHP Version: 5.6.24-0+deb8u1
  • Operating System: Debian 8.5 (linux)
  • Zephir version:: 0.9.2a-dev
  • Server: Nginx + PHP-FPM
@Jurigag
Copy link
Contributor

Jurigag commented Sep 30, 2016

2.0.13 version is no longer maintained and supported. Can you check 3.0.x branch ?

@tugrul
Copy link
Contributor Author

tugrul commented Sep 30, 2016

3.0.x has too buggy with PHP 5.6. so many seg faults. I can't waste my time with 3.0.x

@Jurigag
Copy link
Contributor

Jurigag commented Sep 30, 2016

You can use php 7. What seg faults ? Create issues then. #12154 i know only about this seg fault.

@tugrul
Copy link
Contributor Author

tugrul commented Sep 30, 2016

@Jurigag it is not easy in corporate business. PHP 7 is too young and we can't deal other problems like other php module incompatibility or old codebase incompatibility

http://php.net/manual/en/migration70.incompatible.php

@Jurigag
Copy link
Contributor

Jurigag commented Sep 30, 2016

Too young ? It's almost 10 months men. I already using it in corporate business without ANY problem.

@sergeyklay
Copy link
Contributor

sergeyklay commented Sep 30, 2016

@tugrul Could you please provide an example what exactly does not work for you with Phalcon 3.0.x and PHP5?

@tugrul
Copy link
Contributor Author

tugrul commented Sep 30, 2016

@sergeyklay published a branch on my invo fork. addText and addVideo actions don't have layout output due to view pick. addEvent doesn't have problem without view pick.

@stamster
Copy link
Contributor

stamster commented Oct 1, 2016

I always use pick() method for such needs.

Looking at the behavior of both setLayout() and pick(), how they're suppose to work together in harmony, in other words what do you want to achieve?

Change the layout to be used instead of using the name of the latest controller name
    $this->view->setLayout('main');

Choose a different view to render instead of last-controller/last-action
         $this->view->pick("products/list");

@sergeyklay sergeyklay self-assigned this Oct 1, 2016
@tugrul
Copy link
Contributor Author

tugrul commented Oct 2, 2016

@stamster there is a shared layout on reporting pages like setting date range or kind of product. I needed to print report by different criteria on same table structure. Also table structure can be different by report. Table structure not same each report and i cant put in same view filtering header and table structure in same view file.

You were right if i made simple blog application xD

I can achieve this with duplicate of table structure to action's view file but it's dirty.

@stale
Copy link

stale bot commented Apr 16, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

@stale stale bot added the stale Stale issue - automatically closed label Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issue - automatically closed
Projects
None yet
Development

No branches or pull requests

4 participants