What’s the best way of doing this in cakephp:
I have a Posts model+view+controller with a “Post type” field in my database – linking to my post type id.
The post type ids are:
– Preview
– Review
– News
What I’m asking is: What’s the best way (natively) of retrieving the post type name, without creating a table Post_types and linking it with a post_id.
I tried creating an array in the config lists, it worked but I think it can be better then this.
You could use the
afterFindmethod of yourPostmodel and add there apost_typefield to your results. See also the cookbook.