I'm learning Zend Framework 2 and walked already through the famous Album tutorial. So I've a basic understanding what’s going on but unfortunately I miss a fundamental part about layouts.
I want to build a basic Web application that supposed to have:
- A homepage for guests
- A complete different hompage for logged in user
- Divide the layout in header, content, footer
I've installed the ZF2 Skeleton Application and the Zfcuser module. The site and registration pages show up like they supposed to.
I'll find all layout files in Application/view and the configured path in Application/config/module.config.php
But I have still a couple of questions:
- How can I divide the layout into header, content, footer? (Different templates)
- How can I create my own layout.phtml? Is it best practice to overwrite the one in Application/view or should I create my own module that overwrites the complete view_manager array?
How can I load a different layout according a user is logged in or not? The zfcUser module provides an helper for that:
if(!$this->zfcUserIdentity()):
But I don't know where to add it.
Thank you so much in advance. And if anyone has a good link to a tutorial - please post it. I really appreciate it.