views:

29

answers:

2

I'm developing a basic application with Cakephp. It´s a FAQs page with login for an administrator that can edit the FAQs. The problem is that I want to show the FAQs in the main page as well as a form that allows admins to login. I've seen examples but I don't know how to follow correctly the MVC. How should the Faq, User and (possibly) the app controllers interact to let me show the Faqs and login form in the same page? Once an admin has logged in, it has access to the complete FAQ view, with add/edit/delete options.

+1  A: 

You need to read the official CakePHP documentation and become familiar with the framework.

No one here can offer any specific help until you have a specific question.

Dolph
A: 

Try copying the form definition code from views/users/login.ctp to your FAQ view. Make sure that the form is named properly so that it points at the Users controller. If you're not sure, look in the book.

Then you'll need to redirect to the FAQ page after successful login. If necessary you can define a specific login action for this style of login (say, signin) so that the standard way remains unaltered WRT to login redirect. Include a condition to display the form only when you are not logged in.

Leo