Re: Singular controller name route

2011-11-15 Thread martinp
Thanks for the reply Jeremy, but what I'm actually looking for is a way to do this automatically. In the same way that routes configuration is set up to handle /:controller/:action/*, I would like to set up /:controller_singular/* which would go to the view action. i.e. not naming individual cont

Singular controller name route

2011-11-15 Thread martinp
Has anyone seen or achieved routing whereby all controller view actions can be accessed via the singular name of the controller? e.g. /pages/view/1 can be accessed by page/1; posts/view/1 by post/1; etc I know route classes are possible, I know it's possible to use the inflector, but I haven't be

Re: file upload with ajax

2010-03-04 Thread martinp
This might be of interest: http://www.zurb.com/playground/ajax_upload On Mar 4, 7:12 am, WebRenovator wrote: > My apologies. I was using SWFUploader to do the multiple file uploads. > > On Mar 3, 7:54 pm, Miles J wrote: > > > @WebRenovator - Its impossible to upload files through XMLHttpRequest

Re: Translate + Contain, getting Translations of other Models

2010-02-27 Thread martinp
I think that might be this issue: http://cakephp.lighthouseapp.com/projects/42648/tickets/95-afterfind-and-beforefind-callbacks-not-working-on-associated-models-was-translate-behavior-should-translate-associated-model-data On Feb 26, 1:16 pm, Rafel wrote: > Hello, I have a model categories with t

Re: Complex model associations, pagination and containable

2009-10-08 Thread martinp
' ), 'CourseQualification' => array( 'className' => 'Schools.CourseQualification', 'foreignKey' => false, 'conditions' => &#x

Re: Complex model associations, pagination and containable

2009-09-13 Thread martinp
$preConditions['CourseFee.week_'.$value.' >'] = 0; $preConditions[]['or'] = array('Accommodation.minimum_stay <=' => $value, 'Accommodation.minimum_stay' => null);

Re: Complex model associations, pagination and containable

2009-09-11 Thread martinp
Hello Thanks for your replies. I thought I was watching this topic, but wasn't aware that the discussion had continued without me! Brian - I think you've hit the nail on the head regarding my containment problem, but I still don't have it working. Miles J - I assure you they are all belongsTo as

Re: Validation for FCK Editors field

2009-09-04 Thread martinp
I would ask in a Javascript forum unless you're mixing up your PHP and Javascript, which would be bad. On Sep 4, 12:18 pm, bhushan A wrote: > Hi All, > >    I have integrated fck editor in cakephp. But unable to apply JS > validation for that field. I have tried with >     " document.getElem

Re: Help with Date Range in Forms Helper

2009-09-04 Thread martinp
You can set the minYear and maxYear in the form helper: http://book.cakephp.org/view/480/options-minYear-options-maxYear Then you just have to make sure your conditions are like: array( 'Event.date >=' => $this->data['Event']['min_date'], 'Event.date <=' => $this->data['Event']['max_date']

Re: how to check whether the file has already ben uploaded

2009-09-04 Thread martinp
CakePHP has a file class, with an exists function. Or you can just use PHP's file_exists function. http://api.cakephp.org/class/file#method-Fileexists See also: http://cakebaker.42dh.com/2006/09/20/how-to-use-the-file-class-from-the-core/ On Sep 4, 12:17 pm, ruchika batra wrote: > HiI have cre

Re: Complex model associations, pagination and containable

2009-09-04 Thread martinp
Haven't I got MySQL errors because my model's aren't being contained? On Sep 4, 3:54 am, Miles J wrote: > Well there you go, it aint containing cause your MySQL fails. Try > fixing that first. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Complex model associations, pagination and containable

2009-09-03 Thread martinp
Okay - see below. No returned array because of the MySQL errors. Thanks for your time. $this->paginate['CourseResult'] = array( 'contain' => array( 'Course' => array( 'CourseLanguage',

Re: Complex model associations, pagination and containable

2009-09-03 Thread martinp
Yes. I also have actsAs containable in my app_model, so all models should load the behaviour. On Sep 4, 12:58 am, Miles J wrote: > Are the associations for Model3/4 set within Model2 and vice versa? --~--~-~--~~~---~--~~ You received this message because you are

Re: Complex model associations, pagination and containable

2009-09-03 Thread martinp
Yep, your version looks like it's the same as mine, but mine doesn't work. Anything missing? I've followed the manual, but it doesn't provide an example for deep associations with paginate unfortunately. On Sep 3, 11:20 pm, Alexandru Ciobanu wrote: > On 9/3/2009

Complex model associations, pagination and containable

2009-09-03 Thread martinp
Hello Is this possible? $this->paginate['Model1'] = array( 'contain' => array( 'Model2' => array( 'Model3', 'Model4'

Re: xmlHelper - serialize

2009-04-23 Thread martinp
$xml->serialize($yourData, array('format' => 'tags')); On Mar 9, 11:25 pm, tobi_one wrote: > Thanks Joe for this hint! > How do you know what format options there are? I can't find any > suggestions at the API or docs... > > Looks like format -> elements is getting closer to what I want. > Unfor

Re: The right way to pass vars from a view to the layout?

2009-04-09 Thread martinp
If I've understood correctly I had a very similar problem. I was using the inbuilt pages controller and had an 'AddThis' widget in the footer of the layout that I generally wanted to be visible, but on certain pages it wasn't required. All I did was at the top of the pages I didn't want the 'AddTh

Re: Which editor for Mac OS X?

2009-01-24 Thread martinp
Textmate may not be free, but it's less than $50 and is the best thing since sliced bread. On Jan 23, 8:53 pm, Webweave wrote: > What's your objection to NetBeans? If you're using it as a PHP editor > and it has all the code sense stuff like Komodo but seems to be more > stable to me. > > On Jan

Re: Complex pagination (deep model assoc. & grouping)

2008-12-09 Thread martinp
27;name'].''; >   echo ''; >   echo ''; >   foreach($resultSet['Accommodation'] as $row) { >     echo '' . $row['name'] . ''; >   } >   echo ''; > > } > > I don't think there's

Re: Complex pagination (deep model assoc. & grouping)

2008-12-08 Thread martinp
find and use my Accommodation information, preferably stored as above. So if anyone's got any tips.. On Dec 9, 12:57 am, Joel Perras <[EMAIL PROTECTED]> wrote: > http://debuggable.com/posts/how-to-paginate-a-search-using-the-cakeph... > > -J. > > On Dec 8, 3:45 pm, marti

Complex pagination (deep model assoc. & grouping)

2008-12-08 Thread martinp
Hello I'd be grateful for any advice on the best way to do this. (Cake 1.2 RC3) I have a model Course, which BelongsTo School, which hasMany Accommodation. I want to be able to filter by courses, types of school and types of accommodation. The results also need to be paginated. I've set up my

Re: Jquery or Scriptalicious?

2008-10-31 Thread martinp
Despite the fact that CakePHP comes with a Scriptaculous-powered AJAX Helper, I find JQuery so much easier to use that you don't really need a helper. On Oct 31, 9:30 am, Gianluca Gentile <[EMAIL PROTECTED]> wrote: > jQuery . > > On Oct 30, 11:49 pm, Matthieu <[EMAIL PROTECTED]> wrote: > > > Hell

Re: Helpers specific to certain themes

2008-10-07 Thread martinp
Thanks. That helps. I was thinking along those lines and I've got something closer to what I want. With this code, however, the helper file still needs to be in the generic helpers folder. What I'd ideally like is a way to read the helpers from the current theme and include them... something like

Helpers specific to certain themes

2008-10-07 Thread martinp
Hello. Question: If using themes to control layouts, views etc. is there a way of calling a helper specifically for that theme's view without naming it in the controller? For example, my theme may need to use a helper that all other themes, or indeed the default view, don't require. I'm also try

Some questions about ACL implementation

2008-08-20 Thread martinp
Hopefully these aren't lame questions. Believe me, I've spent lots of time reading every tutorial I can find and lots of threads on this group. I still have a few questions though. 1. Many of the implementations of user groups in ACL have a UserGroup model (User belongsTo UserGroup), which is the

Re: validationErrors in plugins

2008-08-18 Thread martinp
Sorry, ignore me. I hadn't used $this->User->read() before trying to save and this was causing the problem. On Aug 19, 12:47 am, martinp <[EMAIL PROTECTED]> wrote: > Hi - Been staring at this for a few hours now and can't see what the > problem is.. maybe some

validationErrors in plugins

2008-08-18 Thread martinp
Hi - Been staring at this for a few hours now and can't see what the problem is.. maybe someone can help? Somehow my validationErrors are getting lost on their way from the controller to the view. I have a simple form: echo $form->create('Users.User', array('url' => $thi

Model associations to generate a history

2008-03-05 Thread martinp
I'm trying to generate a Facebook-style Mini-feed about my users, so that a profile page will have the general user information and also a history of recent activity, which could be new favourites, new notes about the user, etc. How best to accomplish this? Notes, favourites etc will be stored i

Re: Beautiful URLs with tree behaviour

2008-02-07 Thread martinp
lp? On Feb 7, 9:04 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 7, 8:34 pm, martinp <[EMAIL PROTECTED]> wrote: > > > I should maybe also add that I'm trying to also implement the > > Translate Behaviour with this and the slug field would be hopefully be > > t

Re: Beautiful URLs with tree behaviour

2008-02-07 Thread martinp
} else { $this->set('pagina', $pagina); } } But it's not reading the slug from the i18n table. All help gratefully received. On Feb 7, 7:12 pm, martinp <[EMAIL PROTECTED]> wrote: > I'm getting to grips with the Tr

Beautiful URLs with tree behaviour

2008-02-07 Thread martinp
I'm getting to grips with the Tree behaviour in 1.2, but what I really want to be able to do is have sections and sub-sections in my URLs as required. For example, if my page, "hello", had a parent, "greetings", which in turn had a parent, "common-expressions", I'd like my URL to be /common- expr

Inserting multiple records - datetime issue - Cake 1.2

2008-01-29 Thread martinp
My form is sending data to two tables, families and family_members. It's a registration form that will collect data relevant to the whole family ($this->data['Family']) and to the particular family member ($this->data['FamilyMember'][]). This particular form only has two 'fieldsets' for family mem

Re: Command Line in Mac OSX Leopard

2008-01-24 Thread martinp
4b7eadf87a7a68 On Jan 24, 7:19 pm, martinp <[EMAIL PROTECTED]> wrote: > I finally did it. Thanks for your help everyone. This is how, step-by- > step: > > I set up a file - ~./bash_login (as longint says above). This was done > by typing: > pico .bash_profile > from th

Re: Command Line in Mac OSX Leopard

2008-01-24 Thread martinp
I finally did it. Thanks for your help everyone. This is how, step-by- step: I set up a file - ~./bash_login (as longint says above). This was done by typing: pico .bash_profile from the first directory you're in when you open Terminal (your Users/ username directory). In this (new) file I typed

Command Line in Mac OSX Leopard

2008-01-22 Thread martinp
There's what appears to be a very good screencast on the cakephp site about how to configure Unix so that you can run Cake from the command line. That is, until right at the beginning the author asks you to edit the .profile file, or whatever your equivalent file is. At that point I'm lost. I don'

Re: Auth in 1.2

2008-01-15 Thread martinp
Thanks all. I stripped it all away (as suggested) and started from scratch and got it working. The problem with error messages seemed to be twofold. Firstly that logoutRedirect was actually causing a redirection on login, overriding loginRedirect. Strange. Also, I was incorrectly using loginError

Re: Auth in 1.2

2008-01-15 Thread martinp
s perhaps it is your first suggestion of a config setting? Thanks for your help. On Jan 15, 4:26 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 14, 2008 9:18 PM, martinp <[EMAIL PROTECTED]> wrote: > > > > > Hello > > > I appreciate there's a

Auth in 1.2

2008-01-14 Thread martinp
Hello I appreciate there's a lot of discussion and a few tutorials on Auth in 1.2, but for some reason I can't get it to work at all - even at a basic level. I'm probably doing something noobtastically wrong, so I apologise in advance for my stupidity if so, but I wonder if someone wouldn't mind