Need sanity check please!! One controller Multiple models..

2006-05-25 Thread pat
I just need someone to advise if on right track or not with my code. In this case, when I create a record in one table, I need to create three related records in another table. I have used the $uses clause to set other models in use. from users_controller =

Re: Google Maps + CakePHP Recipe

2006-05-25 Thread Mika
Nice work! Maybe you should post this on cakeforge.net as a snippet, or on wiki.cakephp.org? It will get lost quite soon here on the group. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post

Re: Google Maps + CakePHP Recipe

2006-05-25 Thread [EMAIL PROTECTED]
Nice work, this is definately useful. Thanks for posting it! --~--~-~--~~~---~--~~ 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

Re: Circularity with beforeFilter calling redirect

2006-05-25 Thread GregL
This discussion helped a lot, thanks. I understand the flow better -- one controller instance is created and lasts the lifetime of the request. I implemented nate's suggestion because if I tell my UserController not to redirect then I won't capture the case of not-logged-in users going to /user/e

fundamental dispatcher strategy flawed?

2006-05-25 Thread [EMAIL PROTECTED]
I am new to Cake but have prototyped a few simple apps. I am puzzled by the dispatcher strategy that maps URL directly into function names. e.g. http://mycakeapp/control1/action1 maps into a direct method call on action1 of class control1 This means that many function names that cannot b

Newbie, why does edit break the controller?

2006-05-25 Thread [EMAIL PROTECTED]
I've used the blog tutorial to help me create my first MVC called mtypes You can see it at: http://members.nzpif.org.nz/index.php/mtypes I can list, view, add but I can't get edit to show. My host has the .htaccess bug (waiting for upgrade) so I'm using the long names but that's ok. This is for

Re: New templating component: "Icing"

2006-05-25 Thread CraZyLeGs
Very nice! I'm not very fan of templating engines(too limitating imho), used smarty & flex in the past. I believe tho that for designers, php isn't that intuitive. So this sure would help. Best regards Cake! --~--~-~--~~~---~--~~ You received this message because

Google Maps + CakePHP Recipe

2006-05-25 Thread tom
Quite a few of the things I expected to be very difficult with CakePHP have actually been "a breeze." Well, not a breeze, but doable. Anyway, no fanfare. Here's how to integrate mapping with your application. Add the data fields I'd recommend fields called "latitude" and "longitude," of the type

Re: Many2Many on 2 tables

2006-05-25 Thread Jacek
Thanks for your time. It was realy easy like you wrote. I just defined two $belongsTo accociations like this (I changed label "courses" to "rides") var $belongsTo = array( 'City1' => array('className'=> 'City', '

Re: Redirect within a component?

2006-05-25 Thread RosSoft
class CheckAccessComponent extends Object { var $components = array('Session'); function startup (&$controller) { //this is called automatically $this->controller =& $controller; } function isPerson($notUserRedirect = '/people/login') { if (!$this->Session->check(

Redirect within a component?

2006-05-25 Thread [EMAIL PROTECTED]
I have a simple component that checks if a session variable is set. If it isn't set, I want to redirect the user elsewhere. However, I get an error when I call $this->redirect('place'); What's the solution? Example: class CheckAccessComponent extends Object { var $components = array('Ses

Re: Open file download dialog?

2006-05-25 Thread Jon Bennett
> I want my action to send a content-disposition header to make the > browser open the file download dialog rather that displaying the data. > I order to do so I need cakephp to bypass all layouts, just write the > data to the output buffer and than send the appropriate headers > (content-disposit

Re: AppController not registering Helpers

2006-05-25 Thread nate
Well, yeah, we got it sorted (see above). --~--~-~--~~~---~--~~ 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 t

Re: AppController not registering Helpers

2006-05-25 Thread Scott Sharkey
modfather wrote: > sorry - app_controller.php is in app/controllers/app_controller.php Shouldn't this be in the main app directory? Mine is, anyway. -Scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake P

Re: Open file download dialog?

2006-05-25 Thread RosSoft
Just send the header(".") in your action within your controller , write the data to output buffer, and finally do an exit() to disable layout and timerwatch in debug mode --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Open file download dialog?

2006-05-25 Thread Kabuto
Hi, I want my action to send a content-disposition header to make the browser open the file download dialog rather that displaying the data. I order to do so I need cakephp to bypass all layouts, just write the data to the output buffer and than send the appropriate headers (content-disposition,

Re: cacheaction & flash

2006-05-25 Thread nate
Hmmm, I don't think this is normal. If you continue to experience this issue, please post a ticket to trac.cakephp.org, along with a piece of sample code to reproduce the issue. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

cacheaction & flash

2006-05-25 Thread DJ Spark
when using in my controller: var $cacheAction = true; it always shows the flash page , even in debug mode = 0. Is this the normal behaviour ? when I use var $cacheAction = '1 day'; , as suggested in the manual , I get the very same page i saved (and not the page i told cake to redirected).

Re: read/find relations problem

2006-05-25 Thread AD7six
Hi Jacek, I think a workable solution would be to override the Model contstructor, set the finderQuery as appropriate, and call the parent. That way it is set as you want it ;) Hope it helps, cheers, AD7six --~--~-~--~~~---~--~~ You received this message because

Re: AppController not registering Helpers

2006-05-25 Thread Olivier percebois-Garve
glad you got it. modfather wrote: > thanks for your efforts - yeah something simple - i am sure its > something we all feel, ie you can't see the wood for the trees. > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: read/find relations problem

2006-05-25 Thread Jacek
OK thanks. It works, but I still can't set current language_id in finderQuery. Current language_id is stored in session and can be chanched by user. Is finderQuery constant ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: {n} ?

2006-05-25 Thread Bret Kuhns
Marcelo, consider yourself lucky. Stay away from the evil that is ASP.NET... I've been developing websites for 6 years and I absolutely struggled through the class trying to figure out the very strange microsoft oddities thrown into ASP.NET. You wouldn't believe how involved it is just to put a dr

Re: read/find relations problem

2006-05-25 Thread AD7six
Hi Jacek, In your association defention, you can define the "finderQuery", such that it only returns the current language version. I don't know too much about cusom associations, but again, it's documented in this link: http://wiki.cakephp.org/docs:understanding_associations#associations_notation

Re: Many2Many on 2 tables

2006-05-25 Thread AD7six
Hi Jacek, Not too dificult I don´t think (don´t create 2 tables for Cities!), Just browse here: http://wiki.cakephp.org/docs:understanding_associations#associations_notation. Note that for each association ( you have 2 belongsTo for Cities, and 2 HasOne for Courses) you will need to define the

Re: {n} ?

2006-05-25 Thread Marcelo de Moraes Serpa
Thanks for the explanation! And just for the sake of curiosity, I never used ASP.NET... never used microsoft technology to build websites and probaly won´t anyway (*cough* cake *cough*) :)FFighter. On 5/25/06, Bret Kuhns <[EMAIL PROTECTED]> wrote: Ahah, after just finishing a semester on ASP.NET I

Many2Many on 2 tables

2006-05-25 Thread Jacek
Hi. I'm thinking about model for bus courses between cities. I have 2 tables (cities, courses). Cities table has 2 fields (from_city_id, to_city_id). Both fields are foreign keys to cities table. How to model this association? Is it possible? Maybe I should have 2 tables with cities (fromCity an

read/find relations problem

2006-05-25 Thread Jacek
Hi all. I have database structure like this Content(id, name) Contentdatas(id, data, content_id, language_id). Contentdatas has multilanguage values of content. How to read content instance with only one contentdatas (depends on active language_id stored in session)? Standard read method retur

Re: HABTM Manual foriegn key error?

2006-05-25 Thread olle
Since you tried this, and got the expected result with your new piece of code, this idea is ripe for a Ticket. Thanks for taking care of details, mate. -Olle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake P