Skip to content
Advertisement

Tag: cakephp

cakephp: update hasmany related tables

For example, if we have: from http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html How should we do an update on the Comment table from the User controller given that all these data is submitted using one form? This is somehow the same as my question here: updating related tables in cake which I unfortunately got no correct answer. Can someone enlighten me on how this works?

How do I traverse CakePHP relations?

I’m trying to traverse the relations on CakePHP models. This is the database: I can access product attributes (product->attributes) on a product model but I cannot access the product attributes on Ad model (ad->product->attributes). Here is my code: And here is what I do in the views: What is wrong? How do I access the relation Ad->product->attribute from my Ad

composer is ignoring installer-paths configuration

I’m try using CakePHP for the first time with composer, but I have some problems. I have this composer.json: When I run composer install (or update) –prefer-dist, everything works except smottt/wideimage. This package is being installed in the /Vendor folder instead /app/Vendor, so, installer-paths was ignored. Answer From the documentation. You cannot use this to change the path of any

How to use custom exception from cakephp plugin?

I have some custom exception for my application. I placed them to app where it is running well. Now I want to move them to one of my plugin and use exception from their. I have implemented custom exception as mentioned here: http://book.cakephp.org/2.0/en/development/exceptions.html But, I am looking for same solution if I use exception classes from cakephp plugin. Any suggestion…???

Bake every table in CakePHP?

The database I’m working on has more than 100 tables, so I’m not going to sit here baking a model and controller for each one individually. I would like to bake all of the tables at the same time with something like the .xml files in Hibernate that tells it the limitations on fields so that I don’t have to

cakePHP value for empty option

is there a way to pass a value for the empty option in a select dropdown generated by the FormHelper? I’m creating an input like this: echo $this->Form->input(‘supplier_id’, array(’empty’=>true)); with values supplied automatically from the controller like this and the select box is created like this: but I would like the first option (the empty one) to have a value

Advertisement