views:

297

answers:

4

hi all,

i have to develop frontend/backend application using cakephp.

can you give me advice how should i develop them, using same cakephp library?

or i have to develop them using separate cakephp libraries?

thank you in advance on your answer!

+2  A: 

I am confused - cakePHP would be used to implement both.

PHP would be used to implement the server-side backend. The same "project" would also contain HTML, JS, CSS, etc that will be used to render the front-end within the browser. Any PHP "views" will also execute code on the back-end, although any HTML output will be rendered on the frontend.

Does that help at all? Or am I missing something?

Justin Ethier
A: 

Not quite sure if I understood you correct, but if I did:

You can set up multiple projects using the same cake-core files. The core files don't even need to be placed in the webroot folder..

http://book.cakephp.org/view/35/Advanced-Installation

harpax
+1  A: 

If by frontend/backend, you mean an application with a user interface (frontend) and an administration interface (backend), then you want to refer to the Prefix Routing section of the manual. This will allow you to have separate flow and interfaces (controller/view) for each type of user while sharing the same data (models).

If by frontend/backend, you mean an application (frontend) that communicates with another server application (backend) using web services, then you want to look at the Additional Class Paths section of the manual. This will allow you to share common classes with two (or more) separate applications.

Note: the above two documentation links are for CakePHP 1.3 stable and won't work with version 1.2. (Clarification: both features do exist in 1.2 but the syntax differs, see the 1.2 manual for correct usage.)

deizel
A: 

For your own sanity, you should regard the backend management as part of the same project as the frontend.

The systems I have built generally use view-type methods for the public view and crud-type methods for the admin view. How you lock down the admin is your choice. Personally I don't like the default admin prefix way. I use login and ACL - Mark Story's tutorial on http://book.cakephp.org/ is superb. With that you can password protect methods.

CakePHP is very flexible and extensible and you can make the administration as simple or as flexible as you like.

Leo
Also see Mark Story's blog: http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1
Leo
i was not so clear with my question... for frontend, i would like to have ulr like: http://myapp.com, and for backend http://myapp.com/admindo i need to have separate cakephp libraries, or i can use same for both?
In that case look at http://book.cakephp.org/view/544/Prefix-Routing which will do just that, although you can also achieve what you want using routes.php or .htaccess or both.
Leo
"do i need to have separate cakephp libraries, or i can use same for both?"No. You just need one CakePHP installation, i.e. one cake directory and, of course, you'll use the same database.
Leo