Table name with underscores & Undefined property & Unable to emit headers ....& etc

Dear friends,

please could anyone help me with my simple issue?

According to CakePHP Conventions - 3.10, one can use databse table name with underscores. In my case, I use table name “types_of_packagings”

Table has columns “id” and “name”

When I bake controller, model and templates for this table, then I get following errors for add, index and view (item with id=1 in table) actions:

In fact, index action lists the content of the table, but with errors. Other actions do not work.

Do I use any reserved word in my table name or where is the problem? This problem does not occur when I use table names composed of only one word.

Thank you very much for any help.

Well I guess it gets confused because of the extra s at the end of Types of Packagings name.
CakePHP uses inflection to determine singular from plural names.

The name of the table could be improved in that fact that you use packaging_types instead of types_of_packaging

If you still want to keep that old name try to remove the s at the end of types_of_packagings

Because for me the singluar should be Type of packaging and the plural Types of packaging

But PackagingType and PackagingTypes is a bit more clearer I would say :wink:

Thank you very much KevinPfeifer! I tried to folow conventions but did not realise that only one word in the table name can be plural.Now its clear for me.