K
K
kapai692015-01-23 15:33:05
symfony
kapai69, 2015-01-23 15:33:05

Are there generally accepted standards for naming methods?

For example, there is a ProductBundle bundle, it has some kind of method, for example, addProduct.
Is there a generally accepted standard for how to call it for the user and for the admin panel, that is

#Controller/ProductController.php
ProductController{
//Для пользователя
public function addProductAction{}
//Для админа
public function addProductAdminAction{}
}

Or option two
#Controller/ProductController.php
ProductController{
//Для пользователя
public function addProductAction{}
}

#Controller/ProductAdminController.php
ProductAdminController{
//Для админа
public function addProductAction{}
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2015-01-23
@OnYourLips

The second option looks preferable, the controller will not be overloaded with a large number of methods.

R
Ruslan Kvashnin, 2015-01-23
@RussellKvashnin

There are no generally accepted ones, except for those that are accepted by the framework, and what symphony uses - you can read here
. As a rule, each team / studio / whatever (underline as necessary) uses its own conventions.
And what you have indicated as an example is too indirectly related to naming. These are different architectural solutions.

M
mind3, 2015-01-27
@mind3

Controller/Admin/PageController
Controller/Client/PageController
Don't mix the client side with the admin side. You can also create two bundles, one will be the admin functionality to perform the other client. There are many options, choose the most optimal and convenient for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question