php - CakePHP - Additional field on Model to display list of roles


I need a field in a model (specifically, it is a "User" model), that will list me all the Roles (ARO) as a delimited string (e.g. "Admin, Officer"). However, that field would be a read-only field, which could be used directly on the view.

This is what i have now:

["id"]=>  "1" 
["username"]=> "[email protected]" 
["password"]=> "d1266f045175f0863dfe26d8bdfd9f91f4ca53bb" 
["role_id"]=> "0"

The role_id refers to a ARO role. I would like to have a read-only, view specific field to contain the list of roles.

How to do this properly?

People are also looking for solutions to the problem: consolidate over +1500 wav files and slice them again (in PHP)


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.