RE: Application Architecture

2006-10-26 Thread Grant Davies
Wow, I'm loving cakePHP and have made a ton of progress. What I'm trying to figure out now is the best approach for the xml/view/save. I have my xml loading and figured out and my form, I'm thinking : A) do I use the bake utility to create a concrete version of my model (assume to has all the

Re: swap database rows

2006-10-26 Thread AD7six
Hi fusupo, Yout don't need to delete, you can udpate each row. http://groups-beta.google.com/group/cake-php/search?group=cake-phpq=save+loopqt_g=Search+this+group HTH, AD7six Please note: The manual/bakery is a good place to start any quest for info. The cake search (at the time of writing)

Re: need help with specifying a complex query

2006-10-26 Thread AD7six
Hi Bingo, The sql above seems a bit overcomplex, maybe I'm mising something. Why not: Create a list of unique Singer/Artist Ids from the song model Use that list of Ids. ? To create the singer id list would be something like $data = $this-Singer-Song-findAll(null,array(DISTINCT

Re: need help with specifying a complex query

2006-10-26 Thread AD7six
Ps. Forgot to include this link, which might be useful in creating the constraint on your Song model: http://cakephp.org/pastes/show/abc17e6d6081dc7c2f91540668447d9f HTH, AD7six Please note: The manual/bakery is a good place to start any quest for info. The cake search (at the time of writing)

Ajax submission of form affecting navigation of browser

2006-10-26 Thread Tim Dilks
I need to post a form using Ajax, without affecting the navigation of the browser. I've set the form up using this syntax: echo $ajax-form('/pages/updateMenusInSession', 'post', array(id = menuForm)); I've set the event onunload in the body to submit the form when the user is moving off the

Re: beforeSave()

2006-10-26 Thread carlosrg
It's a shame it can't be. I wanted to save the username automatically... Now I have to put the code '$this-Model-set('user_id', $this-Session-read('User.id'));' in every controller. Do you know a better way to do it? Thanks a lot! --~--~-~--~~~---~--~~ You

Re: Ajax submission of form affecting navigation of browser

2006-10-26 Thread leo.cacheux
I think you could use a hidden DIV (with display:none) to put the result of the Ajax request : echo $ajax-form('/pages/updateMenusInSession', 'post', array(id = menuForm, update=myHiddenDiv)); --~--~-~--~~~---~--~~ You received this message because you are

Re: Ajax submission of form affecting navigation of browser

2006-10-26 Thread Tim
Thanks for the reply Leo, however I'm afraid it didn't seem to work The generated javascript I'm now getting when I view source is this: script type=text/javascript Event.observe('menuForm', 'submit', function(event) { new Ajax.Updater('myHiddenDiv','/pages/updateMenusInSession',

Re: beforeSave()

2006-10-26 Thread Ismael S. Kafeltz
I'm not sure about this, but see this: http://manual.cakephp.org/appendix/simple_user_auth In session 03: Access Checking in your Application You could follow the same ideia, put your code in AppController and extend it. --~--~-~--~~~---~--~~ You received this

Re: Application Architecture

2006-10-26 Thread Grant Cox
I'm not sure what you mean by baking the model - bake is just a command line application to make model/view/controller stubs (although stubs doesn't give them much justice, they are very functional). Even a complete model file will not specify the database fields, except where needed for

Re: need help with specifying a complex query

2006-10-26 Thread bingo
Thanks AD7six and Christoph, got everything working with minimum SQL and in a clean way... For others reference.this was my solution $criteria = array('user_id' = {$userid}); // basicaly get id of the user $songlist = $this-SongsUser-findAll($criteria, array('song_id'), null, null, -1);

Re: HABTM and $validate: ensure at least one value was selected

2006-10-26 Thread akaihola
The VALID_NOT_EMPTY constant is just a regular expression for validating strings. I think you'll need a more customized validation mechanism to do what you want. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake

Re: Problems when using observeField to check password and its confirm

2006-10-26 Thread Samuel
Thanks Finster. bcos I think it is no use to pass other fields when checking the specified field and transport many datas at a time. Any other solutions?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Booleans and checkboxes are broken with PostgreSQL

2006-10-26 Thread akaihola
Something is wrong with booleans and checkboxes when using PostgreSQL. I created a ticket and made a clear test case as well. See https://trac.cakephp.org/ticket/1586 Here's what I've found out so far, please correct me if I'm wrong: $html-checkbox() expects booleans in $this-data in the native

Re: Cake and VALID_NOT_EMPTY

2006-10-26 Thread [EMAIL PROTECTED]
I do save it like anyone else would - the only sanitization I do is $this-cleanUpFields() Firstname and Lastname are two different fields - they aren't combined. They relate to two different columns in a table (Contact.firstname and Contact.lastname) that are not supposed to be blank. Chris:

Re: hasAndBelongsToMany missing field $field

2006-10-26 Thread nate
Open a documentation ticket. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: SMF + CakePHP

2006-10-26 Thread Marcus
Hi, there is no need to use sessions in my Applications. I check the user's cookies before each action with beforeFilter in app_controller.php. This means I have one extra DB read query per action - a value that I can live with ;) Cheers, Marcus On Oct 25, 4:54 pm, [EMAIL PROTECTED] [EMAIL

RE: Application Architecture

2006-10-26 Thread Grant Davies
Thanks Grant, that does make a lot of sense, I do display a form, the xml usually has incomplete data that the user needs to update in the form, so the xml is there just to seed the form. I guess I can read an example record from the database and then dump the associative array to a file so I

RE: CakePHP for Railers

2006-10-26 Thread Jörg W Mittag
Felix Geisendörfer wrote: One of the things that I really like as well is creating Models for relationships. I think I heard about it first in David Heinemeier Hansson Keynote Adress at RailsConf '06 (Video http://blog.scribestudio.com/articles/2006/07/09/david-heinemeier-han

Re: need help with specifying a complex query

2006-10-26 Thread bingo
hi bakers (especially AD7six and Christoph) Now, I did find a solution for specifying the query, but getting a trouble on how to set pagination. I want to set the pagination on name, count or id any ideas on how to do to set pagination. Regards

Re: Select tag with optgroup

2006-10-26 Thread Troy Schmidt
So no one knows about this?? On Oct 25, 11:12 am, Troy Schmidt [EMAIL PROTECTED] wrote: Okay just trying to keep with the same thread. Has anyone used this helper? Is this something included now in the Cake core? -- Forwarded message -- From: zis [EMAIL PROTECTED] Date:

loadPluginModels doesn't check for class existence

2006-10-26 Thread Christoph Neumann
The loadPluginModels function doesn't check for class existence.This is a problem for me because I have to preload some models from a plugin before the cake dispatcher tries to load the rest of the models. I'm using cake 1.1.8.3544.I attached a patch.- Christoph

Re: Ajax submission of form affecting navigation of browser

2006-10-26 Thread Tim
Just in case anybody gets the same problem, it seems that when you use the submit() function on the form, the onsubmit=return false; is NOT invoked, which means that there will be a non Ajax submission as well as an ajaxified one. So it seems the solution is there isn't one, apart from

Re: hasAndBelongsToMany missing field $field

2006-10-26 Thread Mikee Freedom
Ismael, you are correct, there are some oversights in he documentation. however, when I think about the time I've saved and the functionality inherent in CakePHP that these fellas have created for me, you and everyone else... i kind of let it go. don't forget the other resources around for

Re: Select tag with optgroup

2006-10-26 Thread Mikee Freedom
i wouldn't have said it was included in the Cake core unless Nate or someone else has come out and said so in the last 24 hrs. if it is a successful method then I'm sure you could use it in your own helper. i have written a html helper of my own that wraps around most of the existing html

Re: Cake and VALID_NOT_EMPTY

2006-10-26 Thread [EMAIL PROTECTED]
Trailing spaces are dropped in varchar fields, I believe. Here's the reference: VARCHAR values are not padded when they are stored. Handling of trailing spaces is version-dependent. As of MySQL 5.0.3, trailing spaces are retained when values are stored and retrieved, in conformance with

Problems with mod_rewrite

2006-10-26 Thread [EMAIL PROTECTED]
Just got this error after setting up Cake on my server. I have other sites using mod_rewrite without any issues, and I'm not familiar enough with it to figure out what's happening myself. I'm using a development style install for now (entire cake structure inside my htdocs), and the default

Re: Select tag with optgroup

2006-10-26 Thread nate
FormHelper::select in Cake 1.2 supports optgroup tags, but the code posted above is definitely not it. To my knowledge, no one has used this helper. If you think it might be of help to you, by all means, try it out. --~--~-~--~~~---~--~~ You received this

Multiple applications under subdomains

2006-10-26 Thread joel
I have one main application at example.com, and I'd like to install another application at app2.example.com. How can I do something like this, where both apps are utilizing the same cake core? It would be great if I could put both apps in my www directory on my host, and then setup the

newbie-getting setup, no mod-rewrite and getting 404s

2006-10-26 Thread [EMAIL PROTECTED]
Hi, I'm new to frameworks and am checking out Cake. I do NOT have mod-rewrite on my computer but I did set up Cake in the config file to use pretty URLs instead of Mod rewrite. I'm using the development install, and I can see the styled default page at localhost/cake and it says that it can

Re: Multiple applications under subdomains

2006-10-26 Thread Jon Bennett
I have one main application at example.com, and I'd like to install another application at app2.example.com. How can I do something like this, where both apps are utilizing the same cake core? It would be great if I could put both apps in my www directory on my host, and then setup the

Re: newbie-getting setup, no mod-rewrite and getting 404s

2006-10-26 Thread nate
http://manual.cakephp.org/appendix/blog_tutorial See Section 5. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Re: newbie-getting setup, no mod-rewrite and getting 404s

2006-10-26 Thread [EMAIL PROTECTED]
Thanks, I finished the tutorial! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL

hasAndBelongsToMany, always bi-directional?

2006-10-26 Thread Robert
OK, this maybe a stupid question, but are hasAndBelongsToMany, always bi-directional? I.e. I have a Model (Users) and I want to associate it with another model (Albums). When the association is made I don't want Albums 'used up', so use HABTM, but what about the reverse? When setting up the

Re: Multiple applications under subdomains

2006-10-26 Thread cherrio
The solution some what depends on your server config. Do you have access to the httpd.conf file? How are your sub-domains created? If you are using CPanel or something like that they create a folder inside your main site(folder), so in that cause you would move the app directly into it and set

Re: newbie-getting setup, no mod-rewrite and getting 404s

2006-10-26 Thread [EMAIL PROTECTED]
Hi again, I've moved on to trying out the scaffolding feature on one of my tables. I set up the model and controller but when I view the scaffold in my web browser I see all the table data but in the right most column under actions I get a bunch of errors like: Notice: Undefined index: id in

Multi Step Search

2006-10-26 Thread Mikee Freedom
Afternoon all, I've just spent way too much time on my search function trying to make it as good as possible. I'm a medium level PHP developer so I know where I want to be but there are a few steps I'm missing in getting there. Basically, what I would like is a search function similar to that

Re: newbie-getting setup, no mod-rewrite and getting 404s

2006-10-26 Thread [EMAIL PROTECTED]
Nevermind, forgot 'id' was case sensative... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email