I have a function that I want all of my controllers to be able to use, so I have defined it in AppController. Now part of what this function will do has no business being in a controller and so it should be in a model, but since this is a universal operation, it only seems correct that it be
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…???
cakephp shopping cart default admin password
Thanks for reading my post. I planned to create online shopping cart website. so i plan to look at the cakephp shopping cart plugin(due to is awesome). but i like to know the default admin password …
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
CakePHP how to set a message from Model?
I’m trying to send a specific message from Model in beforeSave() method. Flash messages don’t work. I could send this message from Controller and use some parameters but I don’t this this best …
CakePHP cache i18n translate
When I forget to translate something, somewhere Project VIEW, I change the file /app/Locale/por/LC_MESSAGES/default.po and sending it back to the server. But mostly, this ‘new translation’, takes …