Where to put model helper functions in Symfony2

前端 未结 2 1593
耶瑟儿~
耶瑟儿~ 2021-02-20 14:28

I have the following function:

function array_duplicates($array)
{
    $duplicates = array();
    $unique = array_unique($array);
    for ($i = 0; $i < count(         


        
2条回答
  •  日久生厌
    2021-02-20 15:03

    By convention, utility classes go under the Util namespace.

    If you use bundles, a class would go into the YourBundle\Util namespace. If you don't, it would go into the Acme\Util namespace — the src/Acme/Util folder.

提交回复
热议问题