Set row for related model for all actions in a controller

2010-09-07 Thread ramonmaruko
Hello, I have the follow relationship between two models (Company and Branch): Company has many Branch(es) What I want is that all actions of the Branches controller will automatically set company_id to the company set by the url. So the following url would return all branches for the company

Re: CakePHP and Custom Tag/Codes

2010-06-19 Thread ramonmaruko
in this case? On Jun 19, 5:06 pm, euromark dereurom...@googlemail.com wrote: i think your approach is wrong if u use a helper to replace the tags - no elements are needed... see BBCODE helper etc which is already in the bakery or other cake resource pages On 19 Jun., 07:23, ramonmaruko

Re: CakePHP and Custom Tag/Codes

2010-06-18 Thread ramonmaruko
this will do the trick On 12 Jun., 10:05, ramonmaruko ramonmar...@gmail.com wrote: I want to be able to input like this in a textarea: [videos] and when the field containing that is displayed, the [videos]tagwill instead be replaced with a call to the videos element. echo $this-element

CakePHP and Custom Tag/Codes

2010-06-12 Thread ramonmaruko
I want to be able to input like this in a textarea: [videos] and when the field containing that is displayed, the [videos] tag will instead be replaced with a call to the videos element. echo $this-element('videos'); How would I be able to do this? Check out the new CakePHP Questions site

CakeMate and VIM

2010-05-16 Thread ramonmaruko
How do I use CakeMate on VIM? I have the cakemate repository cloned under the plugins directory. cakemate.vim is located inside the ~/.vim/ plugin directory. While using the :M command while I'm on a controller, a couple of errors get displayed: http://pastebin.com/dF53daJb Check out the new

Re: CakeMate and VIM

2010-05-16 Thread ramonmaruko
CakeMate: http://thechaw.com/cakemate CakeMake VIM Plugin: http://thechaw.com/cakemate/source/vendors/vim/plugins/cakephp.vim On May 17, 12:13 am, Bogdan Bursuc bogdanbursu...@gmail.com wrote: What is CakeMate ? On Sun, May 16, 2010 at 12:53 PM, ramonmaruko ramonmar...@gmail.com wrote

Re: Change find type for contained model and other questions

2010-05-15 Thread ramonmaruko
appropriate place to put it? The 'original' choices are still inside the $questions array, unmodified. If anyone knows a better approach, please post it. Thank you. On May 15, 1:42 am, ramonmaruko ramonmar...@gmail.com wrote: I have the following model associations: Response-Survey Response

Change find type for contained model and other questions

2010-05-14 Thread ramonmaruko
I have the following model associations: Response-Survey Response-Question Response-Choice Survey-Question Question-Choice I want to create a form where I could answer all the questions for one survey. So I used the following to return the needed data: $questions =

Re: Media Plugin + PDF files

2010-05-08 Thread ramonmaruko
into Generator Behavior in  1.3.x) attached to the model you are using to upload the file. Detach/disable it and you should be fine. - David On 7 Mai, 21:17, ramonmaruko ramonmar...@gmail.com wrote: Why is it that every time I upload a PDF file, it somehow gets processed by ghostscript? What

Media Plugin: Missing Behavior File

2010-05-07 Thread ramonmaruko
I'm using CakePHP 1.3 Stable and tried Media plugin 1.3alpha and also fetching branch 1.3 I was trying to follow the http://wiki.github.com/davidpersson/media/media-behavior page and have this on my movie.php: var $actsAs = array( 'Media.Transfer',

Re: Media Plugin: Missing Behavior File

2010-05-07 Thread ramonmaruko
Seems like the Media Behavior has been moved to libs(?). I ended up using the Monolithic Attachment Model recipe. On May 7, 9:33 pm, ramonmaruko ramonmar...@gmail.com wrote: I'm using CakePHP 1.3 Stable and tried Media plugin 1.3alpha and also fetching branch 1.3 I was trying to follow

Media Plugin + PDF files

2010-05-07 Thread ramonmaruko
Why is it that every time I upload a PDF file, it somehow gets processed by ghostscript? What is the script doing and is there a way to disable this so that it just plainly uploads the PDF file without converting/resize/whatever it? Thanks, Marco Check out the new CakePHP Questions site

Re: Media Plugin + PDF files

2010-05-07 Thread ramonmaruko
they don't get processed by ghostscript anymore. Marco On May 8, 3:17 am, ramonmaruko ramonmar...@gmail.com wrote: Why is it that every time I upload a PDF file, it somehow gets processed by ghostscript? What is the script doing and is there a way to disable this so that it just plainly uploads

Re: Help in DRY'ing a controllers

2009-03-05 Thread ramonmaruko
Thanks for the links, I think I'll go with grigri's approach. On Mar 5, 1:03 am, keymaster ad...@optionosophy.com wrote: These links may help: http://groups.google.com/group/cake-php/browse_thread/thread/5339fd41...http://groups.google.com/group/cake-php/browse_thread/thread/5339fd41...

Re: Help in DRY'ing a controllers

2009-03-05 Thread ramonmaruko
to set parent::beforefilter() etc. if there is controller callabacks) App:import('Controller', 'Common'); PostController extends CommonController On Mar 4, 3:16 pm, ramonmaruko ramonmar...@gmail.com wrote: I have three controllers that have the same code for the index/add/ edit/delete

Help in DRY'ing a controllers

2009-03-04 Thread ramonmaruko
I have three controllers that have the same code for the index/add/ edit/delete/view actions. How should I refactor the code so that it'll be in just one place, and those three controllers would just inherit the actions from somewhere? Currently, I have the actions defined inside my AppController

saveAll() and hasOne association problem

2009-02-23 Thread ramonmaruko
What do I need to do so that saveAll() will automatically add the correct member_id for this: http://bin.cakephp.org/view/59481259 I have a EmergencyLoan hasOne Beneficiary which uses saveAll() that works perfectly. I can't seem to find what's wrong with the Member hasOne Spouse

Re: saveAll() and hasOne association problem

2009-02-23 Thread ramonmaruko
Removing the bind/unbindModel() 'fixes' the problem. But I think I need to have the bind/unbind since the member may/may not have a spouse. On Feb 23, 6:25 pm, ramonmaruko ramonmar...@gmail.com wrote: What do I need to do so that saveAll() will automatically add the correct member_id

Re: saveAll() and hasOne association problem

2009-02-23 Thread ramonmaruko
It works now. :) I removed the bind/unbindModel() calls and replaced them. http://bin.cakephp.org/view/38527196 ramonmaruko wrote: Removing the bind/unbindModel() 'fixes' the problem. But I think I need to have the bind/unbind since the member may/may not have a spouse. On Feb 23, 6:25 pm

Assigning a model to a variable and accessing it

2009-02-20 Thread ramonmaruko
I know that this is more of a PHP OOP question, but is this possible: http://bin.cakephp.org/view/73084103 ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Multiple Fields for HABTM Relationship

2009-02-15 Thread ramonmaruko
The default input type for a HABTM relationship when I bake is the select one where we could select multiple options(CTRL + Click in Windows) in one field. (Am I correct? I can't look at the source code right now since I'm not at home.) But what I want is that the user would be presented with

Re: Multiple Fields for HABTM Relationship

2009-02-15 Thread ramonmaruko
Whew! I got it working. I changed the name of the select tags from 'data[Member][Member]' to 'data[Member][Member][]' On Feb 16, 3:38 am, ramonmaruko ramonmar...@gmail.com wrote: The default input type for a HABTM relationship when I bake is the select one where we could select multiple

Re: What's wrong with my associations ?

2009-02-13 Thread ramonmaruko
Does your 'businesses' table have at least the following fields columns: id (PRIMARY KEY) name account_id and the accounts table: id (PRIMARY KEY) name On Feb 14, 1:33 pm, Chris Mc cmcclel...@yahoo.com.au wrote: OK, so I thought I had the association (ie relationship) part pretty much

Database Relationship and Design Help

2009-02-09 Thread ramonmaruko
I'm have a problem on how I should 'design' my database for my current project. This is my current design: http://img264.imageshack.us/img264/4396/coopdbjx7.png (In the image it shows member_int, but the actual field name is member_id with a data type of int) Here is what I want it to be:

Re: Database Relationship and Design Help

2009-02-09 Thread ramonmaruko
column member_id in ShortTermLoan is the id of the applicant. On Feb 9, 10:27 pm, mscdex msc...@gmail.com wrote: On Feb 9, 3:11 am, ramonmar...@gmail.com wrote: Here is what I want it to be: Each member can apply for zero or more short term loan(s) A short term loan must have 1 or up

Re: Database Relationship and Design Help

2009-02-09 Thread ramonmaruko
I thought I read somewhere that every table has to have an 'id' column in CakePHP. Anyway, I deleted the column and everything seems to be working fine still. I think I got it already. Thanks. On Feb 9, 10:40 pm, mscdex msc...@gmail.com wrote: Also, this is just a personal design decision but I