Re: Open Source CakePHP Project
Guide for what? Coding standards or just a way to learn cake? If the latter, there is an active discussion here: http://groups.google.com/group/cake-php/t/825c76132e10e0cd. On Jan 21, 4:40 pm, longint <[EMAIL PROTECTED]> wrote: > Just wondering if any of you folks can recommend me a good open source > cake project to use a guide? > > Thanks. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake 1.1.19: Ability to turn debug info off during ajax - Is it broken?
Configure::write('debug', '0'); works. Curious, does anyone know what has changed in 1.1.19 to stop the $db =& ConnectionManager::getDataSource('default'); $db->fullDebug = false; approach from working? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok got it on my end.. Hopefully this can help some others. Problem is in the example code for DAuth user login controller. $this->DAuth->newSalt(); $this->Session->setFlash($error); This resets the message all the time with a blank var ($error is blank unless there has been one) Mod to something like this: $this->DAuth->newSalt(); if (!$this->Session->check('Message.flash') && $error != '') { $this->Session->setFlash($error); } -Ben --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok I've been through it from top to bottom on the writing side of things, sessions, flash code etc. Seems that there is something cleaning up the message value before it gets to the session helper $session->flash(); Before the view (debug($_SESSION) at the top and no message). the message is deleted but everything else remains, even the flash related array. Then once $session->flash(); is called in the view the remaining flash array entries are cleaned up. -Ben --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
On Jan 22, 5:22 am, GardenWeazeL <[EMAIL PROTECTED]> wrote: > I suspect it's because the cake session is named CAKEPHP and the > default session is called PHPSESSID. Exactly I had the same problem lately. Set Configure::write('Session.cookie', 'PHPSESSID'); -- Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
debug(compact('message', 'layout', 'params')); Array ( [message] => foobar [layout] => default [params] => Array ( ) ) That's the debug from the compact that goes into the write inside setFlash. -Ben --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
http://au2.php.net/session_write_close The discussion here seems to indicate a PHP problem of some kind on some systems. or Some missing stuff in cake to garbage collect for all situations? or Well my problem seems to point elsewhere.. __start in setFlash? I encounter the problem with 1.2 + setFlash + redirect. However my old session data (set on previous writes) still exists. Anything set with Session->write works also, while the rest of the setFlash array is present also. Just the message is missing. $this->Session->setFlash('foobar'); $this->Session->write('foo','bar'); $this->redirect(array('controller'=>'users','action'=>'login'), null, true); Resulting debug of $_SESSION: [Message] => Array ( [flash] => Array ( [message] => [layout] => default [params] => Array ( ) ) ) [foo] => bar -Ben --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do I set focus to a form input field?
Just add an ID to the form input: input('title', array('id' => 'title'))?> Then in the JS you can do: document.getElementById('title').focus(); On Jan 22, 5:52 am, Carl <[EMAIL PROTECTED]> wrote: > I used to do this with something like this: > >
Cake without a SQL database
I am working on porting my current web site over to a MVC framework. Right now I am evaluating Cake PHP. I have gone through the blog tutorial and it all makes sense when the back end is a standard SQL database. At present my web site is driven via a XML file and by hard drive queries (images on the hard drive). How would I go about implementing a model that is powered by these types of sources? Sam --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Connecting Two HABTM Tables
Your colors_shirts_sizes table should be a new table/model inventory. Inventory - id - shirt_id - size_id - color_id - inventory_qty ... any other inventory information needed such as location etc. As soon as you need more than just the cross reference id's in the table (like your inventory quantity) it needs to be its own model. Danielle -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of david_setwise Sent: January 21, 2008 3:03 PM To: Cake PHP Subject: Connecting Two HABTM Tables Here is a potential situation in which it seems like two HABTM tables should be connected. So, am I incorrect in my table structure. If not, can Cake handle connecting two HABTM tables? The system in question deals with clothing. So imagine shirts of various types that can have multiple sizes and colors, with the ability to track inventory. The first HABTM is fairly straight forward: Colors > Colors_Shirts > Shirts But if I want to add in sizes, with an inventory for each combination (Plain T-shirt, Green, Size Medium, inventory 20) it get complicated. I envision the correct database structure/relationship as having the Sizes table connected to the Colors_Shirts table with a HABTM relationship, in which the inventory is stored. Colors_Shirts > Colors_Shirts_Sizes (with field for inventory) > Sizes So, is this the way you would structure the database? If so, can Cake handle such a relationship? And if not, does anyone have a decent alternative? Colors - color_id - name Shirts - shirt_id - name - description Sizes - size_id - shortCode Colors_Shirts - color_id - shirt_id Colors_Shirts_Sizes - color_id - shirt_id - size_id - inventory --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
yes i agree, the best for learn is create some little project then debug your project and the most important is using function print_r(),he..he.. :D cake-php is great!!!, than's for cake-php team On Jan 21, 2008 2:18 PM, powtac <[EMAIL PROTECTED]> wrote: > > Thougt to set up a wiki. > What do you think? > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Create Excel using this from the bakery
I followed the guidelines on the bakery relating to this article: http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database Downloaded the two files: http://webdesign.janenanneriet.nl/excel_writer.zip http://webdesign.janenanneriet.nl/ole.zip extracted to ROOT/vendors/ copied helper file to ROOT/app/views/helpers/excel.php added a function on my controller > function export() { > $data = array(); > $data['sheet1'] = $this->Billing->findAll(NULL, NULL, 'id ASC', > NULL, 1, 2); > $this->set('data', $data); > > //print_r($data); > > $this->render('export', 'excel'); > } > Now, i created a ROOT/app/views/controller/export.ctp using this: http://bakery.cakephp.org/articles/download_code/315/block/2 And, when i run this on my browser i got this weird OLE errors.. Notice (8): Constant OLE_PPS_TYPE_ROOT already defined > [/usr/local/php5/lib/php/OLE.php, line 26] > > Context | Code$args = array(0 => "ole/OleRoot") > $c = 1 > $i = 0 > $arg = "ole/OleRoot" > > /** > * Constants for OLE package > */ > > define('OLE_PPS_TYPE_ROOT', 5); > define('OLE_PPS_TYPE_DIR', 1); > > define - /usr/local/php5/lib/php/OLE.php, line 26 > require_once - /usr/local/php5/lib/php/OLE.php, line 26 > require_once - /usr/local/php5/lib/php/OLE/PPS.php, line 24 > require_once - /usr/local/php5/lib/php/Ole.php, line 34 > require_once - CORE/vendors/ole/OlePps.php, line 23 > require_once - CORE/vendors/ole/OleRoot.php, line 23 > vendor - CORE/cake/basics.php, line 751 > require - CORE/app/views/helpers/excel.php, line 13 > loadHelper - CORE/cake/basics.php, line 499 > View::_loadHelpers() - CORE/cake/libs/view/view.php, line 827 > View::_render() - CORE/cake/libs/view/view.php, line 729 > View::render() - CORE/cake/libs/view/view.php, line 320 > BillingsController::render() - CORE/cake/libs/controller/controller.php, > line 664 > BillingsController::export() - > CORE/app/controllers/billings_controller.php, line 72 > Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 276 > Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 248 > require - CORE/app/webroot/index.php, line 85 > [main] - CORE/index.php, line 63 > Constant OLE_PPS_TYPE_DIR already defined [* > /usr/local/php5/lib/php/OLE.php*, line *27*] > Constant OLE_PPS_TYPE_FILE already defined [* > /usr/local/php5/lib/php/OLE.php*, line *28*] > Constant OLE_DATA_SIZE_SMALL already defined [* > /usr/local/php5/lib/php/OLE.php*, line *29*] > Constant OLE_LONG_INT_SIZE already defined [* > /usr/local/php5/lib/php/OLE.php*, line *30*] > Constant OLE_PPS_SIZE already defined [*/usr/local/php5/lib/php/OLE.php*, > line *31*] > > *Fatal error*: Cannot redeclare class ole in * > /usr/local/php5/lib/php/Ole.php* on line *43* > Please help! -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
I've tried this also. SecureImage requires a session but for some strange reason the session is not seen. Here's the code: /** * Class constructor. * Because the class uses sessions, this will attempt to start a session if there is no previous one. * If you do not start a session before calling the class, the constructor must be called before any * output is sent to the browser. * * * $securimage = new Securimage(); * * */ function Securimage() { if ( session_id() == '' ) { // no session has been started yet, which is needed for validation session_start(); } } I've tried commenting out the line: session_start(); But once that line is commented out, the secureimage session doesn't work correctly. I suspect it's because the cake session is named CAKEPHP and the default session is called PHPSESSID. Regards, Andy On Jan 21, 4:49 pm, francky06l <[EMAIL PROTECTED]> wrote: > remove/comment the session creation in the code outside of cake, that > should fix your problem. > hth > > On Jan 21, 11:07 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Yes there is a session_start() in the external code. The code is a > > captcha code for form submission. I might also mention > > that this code is also on a hosted server and the code actually on a > > subdomain. > > > The session_start() in the external code is created outside of the > > cakephp session. Obviously I only want one session per user. > > > Thanks in advance, > > Andy > > > On Jan 21, 1:27 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > Is there any "create_session" in your external code ? > > > > On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Hello all, > > > > I'm fairlly new to cakephp and while it seems to be fairly fast it is > > > > indeed difficult to grasp. > > > > > I have a question concerning sessions. I have a cakephp app the has > > > > external code and is not part of my cakephp app. When a visitor > > > > browses my web site a session is created by cakephp. I have a feedback > > > > page this is only located in my webroot directory and I am trying to > > > > write to the cakephp session. > > > > > I can write to a session but, its not the cakephp session and a > > > > completely new session is created. Any idea why this is happening? I > > > > have set security to "medium" in my core.php file. > > > > > Thanks in advance, > > > > Andy- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ternary and binary relationships together
Hi, I'm new in cakePHP (and in database modeling (and in english:) too)! I have three models (entities): A, B and C. A hasAndBelongsToMany B, A hasAndBelongsToMany C and B hasAndBelongsToMany C All of this join-tables has own attributes and I have a "biggest" ABC join table with own attributes too. So I have A, B, C, A_B, A_C, B_C and A_B_C tables (and models). I can create the table A_B_C in different ways: A_B_C (id, A_B_id, C_id), A_B_C (id, A_C_id, B_id), A_B_C (id, A_id, B_C_id) and finally A_B_C (id, A_id, B_id, C_id). When I create a HABTM relationship in the models A, B or C, there is an "associationForeignKey" key in the $hasAndBelongsToMany array type variable, but only one. The last A_B_C possibility (A_B_C (id, A_id, B_id, C_id)) has more then one "associationForeignKey", so I can't use it (really?). Then I have yet three possibilities: A_B_id and C_id, A_C_id and B_id or B_C_id and A_id. Why the either of them, not the other? Sorry about my english --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
I've tried this also. SecureImage requires a session but for some strange reason the session is not seen. Here's the code: /** * Class constructor. * Because the class uses sessions, this will attempt to start a session if there is no previous one. * If you do not start a session before calling the class, the constructor must be called before any * output is sent to the browser. * * * $securimage = new Securimage(); * * */ function Securimage() { if ( session_id() == '' ) { // no session has been started yet, which is needed for validation session_start(); } } I've tried commenting out the line: session_start(); But once that line is commented out, the secureimage session doesn't work correctly. I suspect it's because the cake session is named CAKEPHP and the default session is called PHPSESSID. Regards, Andy On Jan 21, 4:49 pm, francky06l <[EMAIL PROTECTED]> wrote: > remove/comment the session creation in the code outside of cake, that > should fix your problem. > hth > > On Jan 21, 11:07 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Yes there is a session_start() in the external code. The code is a > > captcha code for form submission. I might also mention > > that this code is also on a hosted server and the code actually on a > > subdomain. > > > The session_start() in the external code is created outside of the > > cakephp session. Obviously I only want one session per user. > > > Thanks in advance, > > Andy > > > On Jan 21, 1:27 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > Is there any "create_session" in your external code ? > > > > On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Hello all, > > > > I'm fairlly new to cakephp and while it seems to be fairly fast it is > > > > indeed difficult to grasp. > > > > > I have a question concerning sessions. I have a cakephp app the has > > > > external code and is not part of my cakephp app. When a visitor > > > > browses my web site a session is created by cakephp. I have a feedback > > > > page this is only located in my webroot directory and I am trying to > > > > write to the cakephp session. > > > > > I can write to a session but, its not the cakephp session and a > > > > completely new session is created. Any idea why this is happening? I > > > > have set security to "medium" in my core.php file. > > > > > Thanks in advance, > > > > Andy- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Fatal error: Cannot redeclare class connectionmanager when using cake acl
I got around this problem by using the "cake schema run create DbAcl" command instead of "cake acl initdb". I found this out by running the "cake acl initdb" command under Linux, and it ran without a problem, but reported "Error: This command is deprecated. Please use, cake schema run create DbAcl". I then ran "cake schema run create DbAcl" successfully under Linux. I went back to the Windows machine, and was able to use "cake schema run create DbAcl" to create the Acl tables. This also seems to have cleared up the original problem, as I'm now able to run "cake acl" without the error message. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How do I set focus to a form input field?
I used to do this with something like this: document.post_form.title.focus(); but CakePHP forms use dot notation in the field names. I haven't found anything in the existing documentation. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Connecting Two HABTM Tables
Here is a potential situation in which it seems like two HABTM tables should be connected. So, am I incorrect in my table structure. If not, can Cake handle connecting two HABTM tables? The system in question deals with clothing. So imagine shirts of various types that can have multiple sizes and colors, with the ability to track inventory. The first HABTM is fairly straight forward: Colors > Colors_Shirts > Shirts But if I want to add in sizes, with an inventory for each combination (Plain T-shirt, Green, Size Medium, inventory 20) it get complicated. I envision the correct database structure/relationship as having the Sizes table connected to the Colors_Shirts table with a HABTM relationship, in which the inventory is stored. Colors_Shirts > Colors_Shirts_Sizes (with field for inventory) > Sizes So, is this the way you would structure the database? If so, can Cake handle such a relationship? And if not, does anyone have a decent alternative? Colors - color_id - name Shirts - shirt_id - name - description Sizes - size_id - shortCode Colors_Shirts - color_id - shirt_id Colors_Shirts_Sizes - color_id - shirt_id - size_id - inventory --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
I've tried this also. SecureImage requires a session but for some strange reason the session is not seen. Here's the code: /** * Class constructor. * Because the class uses sessions, this will attempt to start a session if there is no previous one. * If you do not start a session before calling the class, the constructor must be called before any * output is sent to the browser. * * * $securimage = new Securimage(); * * */ function Securimage() { if ( session_id() == '' ) { // no session has been started yet, which is needed for validation session_start(); } } I've tried commenting out the line: session_start(); But once that line is commented out, the secureimage session doesn't work correctly. I suspect it's because the cake session is named CAKEPHP and the default session is called PHPSESSID. Regards, Andy On Jan 21, 4:49 pm, francky06l <[EMAIL PROTECTED]> wrote: > remove/comment the session creation in the code outside of cake, that > should fix your problem. > hth > > On Jan 21, 11:07 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Yes there is a session_start() in the external code. The code is a > > captcha code for form submission. I might also mention > > that this code is also on a hosted server and the code actually on a > > subdomain. > > > The session_start() in the external code is created outside of the > > cakephp session. Obviously I only want one session per user. > > > Thanks in advance, > > Andy > > > On Jan 21, 1:27 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > Is there any "create_session" in your external code ? > > > > On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Hello all, > > > > I'm fairlly new to cakephp and while it seems to be fairly fast it is > > > > indeed difficult to grasp. > > > > > I have a question concerning sessions. I have a cakephp app the has > > > > external code and is not part of my cakephp app. When a visitor > > > > browses my web site a session is created by cakephp. I have a feedback > > > > page this is only located in my webroot directory and I am trying to > > > > write to the cakephp session. > > > > > I can write to a session but, its not the cakephp session and a > > > > completely new session is created. Any idea why this is happening? I > > > > have set security to "medium" in my core.php file. > > > > > Thanks in advance, > > > > Andy- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Open Source CakePHP Project
Just wondering if any of you folks can recommend me a good open source cake project to use a guide? Thanks. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
Thougt to set up a wiki. What do you think? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
remove/comment the session creation in the code outside of cake, that should fix your problem. hth On Jan 21, 11:07 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > Yes there is a session_start() in the external code. The code is a > captcha code for form submission. I might also mention > that this code is also on a hosted server and the code actually on a > subdomain. > > The session_start() in the external code is created outside of the > cakephp session. Obviously I only want one session per user. > > Thanks in advance, > Andy > > On Jan 21, 1:27 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > Is there any "create_session" in your external code ? > > > On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > Hello all, > > > I'm fairlly new to cakephp and while it seems to be fairly fast it is > > > indeed difficult to grasp. > > > > I have a question concerning sessions. I have a cakephp app the has > > > external code and is not part of my cakephp app. When a visitor > > > browses my web site a session is created by cakephp. I have a feedback > > > page this is only located in my webroot directory and I am trying to > > > write to the cakephp session. > > > > I can write to a session but, its not the cakephp session and a > > > completely new session is created. Any idea why this is happening? I > > > have set security to "medium" in my core.php file. > > > > Thanks in advance, > > > Andy- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
Yes there is a session_start() in the external code. The code is a captcha code for form submission. I might also mention that this code is also on a hosted server and the code actually on a subdomain. The session_start() in the external code is created outside of the cakephp session. Obviously I only want one session per user. Thanks in advance, Andy On Jan 21, 1:27 pm, francky06l <[EMAIL PROTECTED]> wrote: > Is there any "create_session" in your external code ? > > On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > > Hello all, > > I'm fairlly new to cakephp and while it seems to be fairly fast it is > > indeed difficult to grasp. > > > I have a question concerning sessions. I have a cakephp app the has > > external code and is not part of my cakephp app. When a visitor > > browses my web site a session is created by cakephp. I have a feedback > > page this is only located in my webroot directory and I am trying to > > write to the cakephp session. > > > I can write to a session but, its not the cakephp session and a > > completely new session is created. Any idea why this is happening? I > > have set security to "medium" in my core.php file. > > > Thanks in advance, > > Andy- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Bake Default Database
Hello All, Is it possible to direct Bake to more than one database? I was using one local mysql database, but now I'm working on something else. Can Bake use more than one at a time or do I need to change my config file? TIA, beren erchamion --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Redirecting to another url in cake
A couple of things: first, I'd use the html link helper to make links. link('Test', '/controller/action'); ?> Second, it should be /controller/action, not controller/action. Third, pagesController is a built-in part of cake, so you can't have a controller called pages. In reference to your routes question, no, you shouldn't have to set a route for every link you make. If you follow the /controller/action model, things should just work. hydra12 On Jan 21, 2:45 pm, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello hydra, > > you got my point right. But here i have a little query regarding routes as > well. Please bear with me as i am new to cake. > > lets say that i have a layout default.thtml. and i am having a link in the > default page which points to some other page(which happens to be the cake > page itself). Let the other controller be PagesController. now here is how i > wrote the link to the pages controller's index action in default.thtml. > > Test > > This above link does not redirect to the index action and finally to the > index.thtml of PagesController untill i define the entry saying > > $Route->connect('/pages/*', array('controller' => 'pages', 'action' => > 'index')); in routes.php > > Is this how cake designed to work? Am i supposed to route every such entry > in routes.php? > > Any help is highly appreciated. > > Thanks. > > On 1/21/08, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm still unsure what you are wanting. Are all of these new pages > > going to be cake pages, or are they going to be static pages? If they > > are cake pages, then your two points are correct. Sometimes it is > > easier to make a new layout. > > > On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> > > wrote: > > > Hello, > > > > Actually i am trying to port a legacy application. In the page there are > > a > > > lot of forwards thro html tag. Now what i was thinking was that > > > what is the best way to convert these tags new layouts, or the same > > layout > > > with different views loading at different time. After i researched i > > came to > > > following conclusions: > > > > 1. If the layout is quite different, then new layout would be better > > > otherwise existing layout would be cluttered with code. > > > 2. If the layout is not that different, then new view in the same layout > > is > > > a better choice. > > > > Please correct me if i am wrong. > > > > Thanks. > > > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > What exactly are you trying to accomplish? > > > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > > > wrote: > > > > > Hello guys, > > > > > > What is the best way to handle the redirections such as in cake php. Do i define new layout for the > > page > > > > > mypage or should i have seperate view and load it in the exisiting > > > > layout > > > > > only. The new page to be loaded is quite different from the another > > > > page. > > > > > > -- > > > > > Thanks & Regards, > > > > > Novice (http://ishuonweb.wordpress.com/). > > > > -- > > > Thanks & Regards, > > > Novice (http://ishuonweb.wordpress.com/). > > -- > Thanks & Regards, > Novice (http://ishuonweb.wordpress.com/).- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Redirecting to another url in cake
Hello hydra, you got my point right. But here i have a little query regarding routes as well. Please bear with me as i am new to cake. lets say that i have a layout default.thtml. and i am having a link in the default page which points to some other page(which happens to be the cake page itself). Let the other controller be PagesController. now here is how i wrote the link to the pages controller's index action in default.thtml. Test This above link does not redirect to the index action and finally to the index.thtml of PagesController untill i define the entry saying $Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'index')); in routes.php Is this how cake designed to work? Am i supposed to route every such entry in routes.php? Any help is highly appreciated. Thanks. On 1/21/08, hydra12 <[EMAIL PROTECTED]> wrote: > > > I'm still unsure what you are wanting. Are all of these new pages > going to be cake pages, or are they going to be static pages? If they > are cake pages, then your two points are correct. Sometimes it is > easier to make a new layout. > > On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> > wrote: > > Hello, > > > > Actually i am trying to port a legacy application. In the page there are > a > > lot of forwards thro html tag. Now what i was thinking was that > > what is the best way to convert these tags new layouts, or the same > layout > > with different views loading at different time. After i researched i > came to > > following conclusions: > > > > 1. If the layout is quite different, then new layout would be better > > otherwise existing layout would be cluttered with code. > > 2. If the layout is not that different, then new view in the same layout > is > > a better choice. > > > > Please correct me if i am wrong. > > > > Thanks. > > > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > > > What exactly are you trying to accomplish? > > > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > > wrote: > > > > Hello guys, > > > > > > What is the best way to handle the redirections such as in cake php. Do i define new layout for the > page > > > > mypage or should i have seperate view and load it in the exisiting > > > layout > > > > only. The new page to be loaded is quite different from the another > > > page. > > > > > > -- > > > > Thanks & Regards, > > > > Novice (http://ishuonweb.wordpress.com/). > > > > -- > > Thanks & Regards, > > Novice (http://ishuonweb.wordpress.com/). > > > -- Thanks & Regards, Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
> I can't be alone in > wondering what the most efficient way to get into CakePHP is. Good guides seem to be the main thing missing from CakePHP - there are plenty of tips about how to do one or two specific things at a time, but not much in the way of a beginner's guide that gives you a good overview of how to get your first Cake powered site up and running. I'm hoping to start work on writing such a guide over the next few days, if no one here objects to me doing so. I'd be happy to share works-in-progress with anyone who can tell me if they find it helpful or not. But yes, as most other people here have stated, the best way is to just get stuck in, read as much of the documentation and guides as exist so far, and then check the archives of this group and post new questions for anything you still need help with. They're a very helpful bunch here! Zoe. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to test that adatabase table exists ?
On Jan 18, 2008 6:39 PM, foxmask <[EMAIL PROTECTED]> wrote: > > Good evening, > I would like to test if my database table exists or not > If no, i will display a message to suggest to install the software > If yes, i will "Route::connect()" to the main page of the software. > > I digged on the Model::Schema() but i dunno how to use it nor if it's > the well way to do the trick. > Another way to do it is to use $this->Model->loadInfo(). According to the function description: "Returns an array of table metadata (column names and types) from the database." So perhaps try with: if( $this->ModelName->loadInfo() ) { // table exists } else { // table doesn't exist } Come to think of it, it may return an empty array which could mean the table exists but has no columns defined, so try it out and see what the function returns in all 3 cases (table exists and columns defined, table exists and no columns defined, table doesn't exist). HTH, Gonzalo --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to test that adatabase table exists ?
i will test thank's a lot ;) On Jan 21, 6:14 pm, hydra12 <[EMAIL PROTECTED]> wrote: > Here's an idea: assuming you have a table users with data in it and a > table schools that is empty. In the users controller: > > function test() > { > $data = "select * from users limit 0,1"; //custom query, limit > to make things run faster > $temp = $this->User->execute($data); > if($temp) > { > debug('table exists'); > } > else > { > debug('table does not exist'); > } > > } > > When I call /users/test, I get 'table exists'. If I change $data to > use the schools table instead of the users table, I get 'does not > exist' - it returns no data because the table is empty. If I change > users to a non-existent table like tests, I get 'does not exist' - the > table doesn't exist. > > There may be a better way to do this, but I can't find it. > > On Jan 20, 7:54 am, foxmask <[EMAIL PROTECTED]> wrote: > > > Hello > > nobody to give a suggestion ? > > > On Jan 18, 9:39 pm, foxmask <[EMAIL PROTECTED]> wrote: > > > > Good evening, > > > I would like to test if my database table exists or not > > > If no, i will display a message to suggest to install the software > > > If yes, i will "Route::connect()" to the main page of the software. > > > > I digged on the Model::Schema() but i dunno how to use it nor if it's > > > the well way to do the trick. > > > > kind regards. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePhp & Strange Session behavior
Is there any "create_session" in your external code ? On Jan 21, 8:05 pm, GardenWeazeL <[EMAIL PROTECTED]> wrote: > Hello all, > I'm fairlly new to cakephp and while it seems to be fairly fast it is > indeed difficult to grasp. > > I have a question concerning sessions. I have a cakephp app the has > external code and is not part of my cakephp app. When a visitor > browses my web site a session is created by cakephp. I have a feedback > page this is only located in my webroot directory and I am trying to > write to the cakephp session. > > I can write to a session but, its not the cakephp session and a > completely new session is created. Any idea why this is happening? I > have set security to "medium" in my core.php file. > > Thanks in advance, > Andy --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePhp & Strange Session behavior
Hello all, I'm fairlly new to cakephp and while it seems to be fairly fast it is indeed difficult to grasp. I have a question concerning sessions. I have a cakephp app the has external code and is not part of my cakephp app. When a visitor browses my web site a session is created by cakephp. I have a feedback page this is only located in my webroot directory and I am trying to write to the cakephp session. I can write to a session but, its not the cakephp session and a completely new session is created. Any idea why this is happening? I have set security to "medium" in my core.php file. Thanks in advance, Andy --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model with no data source / database - how to do this in CakePHP 1.2?
You still have to have database.php file in your /app/config. Content of the file is list of data sources u will use in your app. Default one must be there, otherwise it will throw you those fatal errors. So your database.php file should at least look like this (copied from database.php.default). class DATABASE_CONFIG { var $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', 'port' => '', 'login' => 'user', 'password' => 'password', 'database' => 'database_name', 'schema' => '', 'prefix' => '', 'encoding' => '' ); } --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
Read through the manual for a general understanding. For actual coding examples (the few that are there) go to the tempdocs. Baking helped me a lot! If you're not sure what baking is, it's the process by which you have cake create the files for the project based on only the database definition. Happy Baking. On Jan 21, 2008 11:59 AM, dr. Hannibal Lecter <[EMAIL PROTECTED]> wrote: > > Trial and error! > > It's a bit difficult at the beginning, and everything is confusing, > but once you get it, as RichardAtHome said, skyrocket! :-) As an > example, I'm messing with Cake for a short while now, and I've decided > to create a private "mini cms" for myself and learn Cake while doing > that. My next step will probably be some sort of mini ticked system / > bug tracking for work, also to learn Cake. > > Besides, it's so easy you can learn it just by playing around :-) > > Good luck! > dr. H. > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: question about phpThumb
It is a PHP library for generating thumbnails, but I'm using this component: http://bakery.cakephp.org/articles/view/phpthumb-component to implement it. Thanks, Dave On Jan 21, 10:09 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 21, 2008 11:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Does anyone know how to disable the error images? If phpThumb ever > > errors out it turns the entire page into an image with the error on > > it. I'd like it to just not generate the thumb and keep parsing. I've > > tried setting $PHPTHUMB_CONFIG['disable_debug'] = true; in the > > phpThumb.config.php file but it doesn't seem to do anything. > > Is this phpThumb thing a CakePHP component or something? > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Postal code validation for multiple countries
I need to check my postal code field for Canada and US postal codes.. I tried using the following postal validation but it doesn't work.. 'postal_code' => array( 'zip' => array( 'rule' => array('postal', null, 'us'), 'required' => true, 'allowEmpty'=> false, 'message' => 'Invalid postal/zip code' ), 'postal' => array( 'rule' => array('postal', null, 'ca'), 'required' => true, 'allowEmpty'=> false, 'message' => 'Invalid postal/zip code' ) ) it seems perhaps this type of validation is ANDed and not ORd .. Is this correct? Is there a way I can check for both countries without writing my own validation routine? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
weird behavior in CakePHP 1.2 (possible bug)
I'm seeing some weird behavior in CakePHP 1.2 that may be a possible bug, and wonder if anyone else can confirm it, or if it's just my server. I'm using the beta download from cakephp.org. Whenever I make a call to a variable in my view that is undefined I get this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 58337 bytes) in C:\InstantRails\www\emerge\cake\libs \debugger.php on line 398 and the parser stops. Line 398 of debugger is in the middle of function __object($var), if I comment out the call to this on lin 364: //causes some sort of overflow //case 'object': // return get_class($var) . "\n" . $_this->__object($var); The overflow disappears and I get the correct error in my view: Notice (8): Undefined variable: newdasfsd [APP\views\users \index.thtml, line 10] Can anyone else reproduce this? Thanks, Dave --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Error editing a record without foreign key
On 21 ene, 18:04, dandreta <[EMAIL PROTECTED]> wrote: > ? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pass elements from one list to other one in HABTM
On 21 ene, 18:05, dandreta <[EMAIL PROTECTED]> wrote: > Any suggestion please? > > On 19 ene, 14:03, dandreta <[EMAIL PROTECTED]> wrote: > > > Hi! > > I have an HABTM relation between ModelA and ModelB. > > In the add view of A, I have created two lists(two multiple selects), > > one with all B > > elements of the database and other one empty . I pass elements of the > > first list to the second one with javascript and the second list will > > contain the B elements that will be related to the A element which I > > am creating. > > > The problem is that in order that controllerA obtains > > the B elements of the second list I must select them with the mouse. > > Then > > it saves the relations ok. But, if I only pass elements to second list > > (and I don't click them with the mouse) the relations do not save. > > But, anyone knows how I can achieve that the elements of the second > > list do not have to be selected with the mouse? > > > Has anyone do something similar? > > Any suggestion or help? > > Thanks and regards --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
I recommend that, first off, you have these prerequisites: * Solid PHP skills, including a basic understanding of using OOP (object-oriented programming) in PHP * MySQL skills * A basic understanding of what an MVC framework is With that foundation, I recommend that you begin with, in the following order: 1. The 15-minute blog tutorial 2. The "temp docs" for CakePHP 1.2. A previous poster linked to this. But it's incomplete, so get comfortable in... 3. 1.2 Beta's API. Things have changed, and in fact, the 15-minute blog tutorial won't entirely work if you use Cake 1.2 Along the way, ask any non-obvious questions in this Google Group, and on the #cakephp channel in IRC. Thomas On Jan 21, 9:04 am, Oxygen <[EMAIL PROTECTED]> wrote: > I've been playing around with CakePHP for a little over 24 hours in > total now and I've just given up on the IBM "Cook up Web sites fast" > tutorial; it was hopelessly buggy and inconsistent. I don't want to > rant, and obviously some parts are out of date, but for this tutorial > to be one of the suggested ways of getting started seems a little > wrong. > > I have a bad habit of sticking with a tutorial once I've started, I > should probably have given up sooner, but I can't be alone in > wondering what the most efficient way to get into CakePHP is. > > Thanks, > Ben Heley --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
Trial and error! It's a bit difficult at the beginning, and everything is confusing, but once you get it, as RichardAtHome said, skyrocket! :-) As an example, I'm messing with Cake for a short while now, and I've decided to create a private "mini cms" for myself and learn Cake while doing that. My next step will probably be some sort of mini ticked system / bug tracking for work, also to learn Cake. Besides, it's so easy you can learn it just by playing around :-) Good luck! dr. H. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
Good question! The answers will show you that the manual and the tutorial for version 1.2 are not finished yet. My (current) way to learn cake is to set up and expand a very small projekt. Each question witch came up I post here (after searching if it wasnt already answerd). I think this is for the moment (no books, no good tutorials, no finished manual) the best way. As you can see the frequency in this google group is very, very high. See my beginner questions: http://groups.google.com/groups/search?enc_author=e4yHJw07kbh6Vc-0CxkmwFvf8foo&scoring=d ;) --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
Hi Using "$this->base" is probably better. It's a property that's available in both controllers and views, and which contains the root cake path... Then your url would look like this : contentUrl: "base ?>/generals/view"+viewId It's better because you won't need to change it all the time in case you move your cake install or decide to call your app "store" instead of "inventory" (for example) See also $html->url() (for Cake 1.1) or Router::url() (Cake 1.2) They're useful. +++ clément On Jan 21, 2008 6:06 PM, ryoungsma <[EMAIL PROTECTED]> wrote: > > Thank you so much for the help. With your guidance I was able to work > this out. If interested here is the what it looks like. > > > function createNewWindow(id) > { > var host =''; > var viewId = id; > var newWindowModel = new DHTMLSuite.windowModel( > {windowsTheme:false,id:'newWindow', > title:'New dynamically created window', > xPos:200,yPos:200,minWidth:null,minHeight:null } ); > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > contentUrl:"http://"+host+"/inventory/generals/view/"+viewId} ); > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > newWindowWidget.init(); > } > > > I now pass an 'id' to the script as well. > > Thank you. > > On Jan 21, 10:58 am, hydra12 <[EMAIL PROTECTED]> wrote: > > OK, a couple of things. First, I've never used DHTML Suite, but this > > works for me using extjs. I think it will work for you, too. > > > > First, try hard-coding your url: > > > > contentUrl: 'http://localhost/myapp/vendor/view/107'//or whatever > > your url is :-) > > > > Note: if you put localhost in, you have to call the site from > > localhost in your browser or you get permission denied errors on your > > ajax call. For example, my dev laptop is named tc-mark-lap. If I put > > localhost in my js code but try to call the code > > withhttp://tc-mark-lap/myapp/vendor/view/107in my browser, it won't work. > > > > > This will (I hope) fix your problem. You can check firebug to see > > what your ajax call returns (to make sure that your ajax is working > > even if there is a problem with your js code). In my code, I define a > > javascript variable in my default layout like this: > > > > > > var host = ''; > > > > > > In my javascript code, I put this for my ajax url: contentUrl: > > 'http://'+host+'/myapp/vendor/view/107' > > > > I hope that helps some. > > > > hydra12 > > > > On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > > Here is the js code to generate the window > > > > > > > > function createNewWindow() > > > { > > > var newWindowModel = new DHTMLSuite.windowModel( > > > {windowsTheme:false,id:'newWindow', > > > title:'New dynamically created window', > > > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > > > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > > > contentUrl:'vendor\view\107' } );\\this is the URL to load > > > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > > > newWindowWidget.init();} > > > > > > > > Create window > > > > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > > Can you show the relevant js code? Specifically, how are you > > > > inputting the url? > > > > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > > > application. I am using their Window Widget to retrieve some > > > > > information via AJAX. The issue is that it uses the URL as a > > > > > parameter when when you create the window from Javascript. Cake > > > > > always seems to return a message that it is looking for a different > > > > > controller. > > > > > > > For example, the URL entered into the parm field is '\vendors\view > > > > > \105' > > > > > > > Here is what Cake is reporting for an error. > > > > > > > > > class VendorsController extends AppController { > > > > > > > var $name = 'Vendors'; > > > > > > > function viewG() { > > > > > > > } > > > > > > > } > > > > > > > ?> > > > > > > > Any thoughts? Have I provided enough information? Thank you! > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Fatal error: Cannot redeclare class connectionmanager when using cake acl
I'm using version 1.2.0.6311 with PHP 4.1.1. I have a working Cake app and now I'm trying to add access controll. I get the following error message when running "cake acl". Fatal error: Cannot redeclare class connectionmanager in c:\vr\Dev \htdocs\_cake_files\cake\cake\libs\model\connection_manager.php on line 44 I am running from my App directory which is configured properly for the database. If I run from a directory where the DB is not configured it starts to walk me through setting up the default database parameters. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting ID of dropped sortable?
I have multiple sortable unordered lists that are generated from entries in a database. I'm currently using $ajax->sortable to make all of these ajax sortable, but I'd like to have the lists update database entries when things are moved from one list to another. So I don't want to use serialize, since I don't really care what order the items are in -- I just want to know the id of the list that it's in. Is there a way to identify the parent list of the item that was just dragged using javascript? Thanks. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model with no data source / database - how to do this in CakePHP 1.2?
I get the same error for both $useTable = false, and $useTable = null Fatal Error (256): ConnectionManager::getDataSource - Non-existent data source default [CORE\cake\libs\model\connection_manager.php, line 113] On Jan 21, 5:18 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 21, 2008 11:02 AM, Matt <[EMAIL PROTECTED]> wrote: > > > > > I've got an application built in CakePHP 1.1 and I am having trouble > > in my attempts to port it to 1.2 as my models which had no data > > source / database are giving me errors. > > > Back in CakePHP if you want a model that didn't use the database you > > just set $useTable = false but this doesn't work in 1.2 as I get the > > error: > > Did you try $useTable = null > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Redirecting to another url in cake
I'm still unsure what you are wanting. Are all of these new pages going to be cake pages, or are they going to be static pages? If they are cake pages, then your two points are correct. Sometimes it is easier to make a new layout. On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello, > > Actually i am trying to port a legacy application. In the page there are a > lot of forwards thro html tag. Now what i was thinking was that > what is the best way to convert these tags new layouts, or the same layout > with different views loading at different time. After i researched i came to > following conclusions: > > 1. If the layout is quite different, then new layout would be better > otherwise existing layout would be cluttered with code. > 2. If the layout is not that different, then new view in the same layout is > a better choice. > > Please correct me if i am wrong. > > Thanks. > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > What exactly are you trying to accomplish? > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > wrote: > > > Hello guys, > > > > What is the best way to handle the redirections such as in cake php. Do i define new layout for the page > > > mypage or should i have seperate view and load it in the exisiting > > layout > > > only. The new page to be loaded is quite different from the another > > page. > > > > -- > > > Thanks & Regards, > > > Novice (http://ishuonweb.wordpress.com/). > > -- > Thanks & Regards, > Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling one page from another
> Also, make sure that your method ends with: > return($datayouwanttoreturn); Thank you! This is what I was missing. I'm so used to CakePHP being magical that I assumed it'd to something amazing like return the $this- >set variables automatically. Now that I've ended the method being called with return($anArrayContainingTheVariablesToGetOut), it's working perfectly. Thanks! > You can also define the function in your method That's another good point. I can't believe I overlooked that this method should probably belong to the model, not the controller. (I had last week off work and spent most of it working on my own CakePHP project, and I was getting in the habit of using the model more for a yummy, equally-layered cake. Now I'm working on an older project again, with code from before I knew CakePHP well.) Thanks again! Zoe. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
I'm glad it worked for you! On Jan 21, 11:06 am, ryoungsma <[EMAIL PROTECTED]> wrote: > Thank you so much for the help. With your guidance I was able to work > this out. If interested here is the what it looks like. > > > function createNewWindow(id) > { > var host =''; > var viewId = id; > var newWindowModel = new DHTMLSuite.windowModel( > {windowsTheme:false,id:'newWindow', > title:'New dynamically created window', > xPos:200,yPos:200,minWidth:null,minHeight:null } ); > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > contentUrl:"http://"+host+"/inventory/generals/view/"+viewId} ); > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > newWindowWidget.init();} > > > > I now pass an 'id' to the script as well. > > Thank you. > > On Jan 21, 10:58 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > OK, a couple of things. First, I've never used DHTML Suite, but this > > works for me using extjs. I think it will work for you, too. > > > First, try hard-coding your url: > > > contentUrl: 'http://localhost/myapp/vendor/view/107'//orwhatever > > your url is :-) > > > Note: if you put localhost in, you have to call the site from > > localhost in your browser or you get permission denied errors on your > > ajax call. For example, my dev laptop is named tc-mark-lap. If I put > > localhost in my js code but try to call the code > > withhttp://tc-mark-lap/myapp/vendor/view/107inmy browser, it won't work. > > > This will (I hope) fix your problem. You can check firebug to see > > what your ajax call returns (to make sure that your ajax is working > > even if there is a problem with your js code). In my code, I define a > > javascript variable in my default layout like this: > > > > > var host = ''; > > > > > In my javascript code, I put this for my ajax url: contentUrl: > > 'http://'+host+'/myapp/vendor/view/107' > > > I hope that helps some. > > > hydra12 > > > On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > Here is the js code to generate the window > > > > > > > function createNewWindow() > > > { > > > var newWindowModel = new DHTMLSuite.windowModel( > > > {windowsTheme:false,id:'newWindow', > > > title:'New dynamically created window', > > > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > > > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > > > contentUrl:'vendor\view\107' } );\\this is the URL to load > > > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > > > newWindowWidget.init();} > > > > > > > Create window > > > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > Can you show the relevant js code? Specifically, how are you > > > > inputting the url? > > > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > > > application. I am using their Window Widget to retrieve some > > > > > information via AJAX. The issue is that it uses the URL as a > > > > > parameter when when you create the window from Javascript. Cake > > > > > always seems to return a message that it is looking for a different > > > > > controller. > > > > > > For example, the URL entered into the parm field is '\vendors\view > > > > > \105' > > > > > > Here is what Cake is reporting for an error. > > > > > > > > > class VendorsController extends AppController { > > > > > > var $name = 'Vendors'; > > > > > > function viewG() { > > > > > > } > > > > > > } > > > > > > ?> > > > > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model with no data source / database - how to do this in CakePHP 1.2?
On Jan 21, 2008 11:02 AM, Matt <[EMAIL PROTECTED]> wrote: > > I've got an application built in CakePHP 1.1 and I am having trouble > in my attempts to port it to 1.2 as my models which had no data > source / database are giving me errors. > > Back in CakePHP if you want a model that didn't use the database you > just set $useTable = false but this doesn't work in 1.2 as I get the > error: > Did you try $useTable = null -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to test that adatabase table exists ?
Here's an idea: assuming you have a table users with data in it and a table schools that is empty. In the users controller: function test() { $data = "select * from users limit 0,1"; //custom query, limit to make things run faster $temp = $this->User->execute($data); if($temp) { debug('table exists'); } else { debug('table does not exist'); } } When I call /users/test, I get 'table exists'. If I change $data to use the schools table instead of the users table, I get 'does not exist' - it returns no data because the table is empty. If I change users to a non-existent table like tests, I get 'does not exist' - the table doesn't exist. There may be a better way to do this, but I can't find it. On Jan 20, 7:54 am, foxmask <[EMAIL PROTECTED]> wrote: > Hello > nobody to give a suggestion ? > > On Jan 18, 9:39 pm, foxmask <[EMAIL PROTECTED]> wrote: > > > Good evening, > > I would like to test if my database table exists or not > > If no, i will display a message to suggest to install the software > > If yes, i will "Route::connect()" to the main page of the software. > > > I digged on the Model::Schema() but i dunno how to use it nor if it's > > the well way to do the trick. > > > kind regards. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: question about phpThumb
On Jan 21, 2008 11:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Does anyone know how to disable the error images? If phpThumb ever > errors out it turns the entire page into an image with the error on > it. I'd like it to just not generate the thumb and keep parsing. I've > tried setting $PHPTHUMB_CONFIG['disable_debug'] = true; in the > phpThumb.config.php file but it doesn't seem to do anything. > Is this phpThumb thing a CakePHP component or something? -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
Thank you so much for the help. With your guidance I was able to work this out. If interested here is the what it looks like. function createNewWindow(id) { var host =''; var viewId = id; var newWindowModel = new DHTMLSuite.windowModel( {windowsTheme:false,id:'newWindow', title:'New dynamically created window', xPos:200,yPos:200,minWidth:null,minHeight:null } ); newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', contentUrl:"http://"+host+"/inventory/generals/view/"+viewId} ); var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); newWindowWidget.init(); } I now pass an 'id' to the script as well. Thank you. On Jan 21, 10:58 am, hydra12 <[EMAIL PROTECTED]> wrote: > OK, a couple of things. First, I've never used DHTML Suite, but this > works for me using extjs. I think it will work for you, too. > > First, try hard-coding your url: > > contentUrl: 'http://localhost/myapp/vendor/view/107'//or whatever > your url is :-) > > Note: if you put localhost in, you have to call the site from > localhost in your browser or you get permission denied errors on your > ajax call. For example, my dev laptop is named tc-mark-lap. If I put > localhost in my js code but try to call the code > withhttp://tc-mark-lap/myapp/vendor/view/107in my browser, it won't work. > > This will (I hope) fix your problem. You can check firebug to see > what your ajax call returns (to make sure that your ajax is working > even if there is a problem with your js code). In my code, I define a > javascript variable in my default layout like this: > > > var host = ''; > > > In my javascript code, I put this for my ajax url: contentUrl: > 'http://'+host+'/myapp/vendor/view/107' > > I hope that helps some. > > hydra12 > > On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > Here is the js code to generate the window > > > > > function createNewWindow() > > { > > var newWindowModel = new DHTMLSuite.windowModel( > > {windowsTheme:false,id:'newWindow', > > title:'New dynamically created window', > > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > > contentUrl:'vendor\view\107' } );\\this is the URL to load > > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > > newWindowWidget.init();} > > > > > Create window > > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > Can you show the relevant js code? Specifically, how are you > > > inputting the url? > > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > > application. I am using their Window Widget to retrieve some > > > > information via AJAX. The issue is that it uses the URL as a > > > > parameter when when you create the window from Javascript. Cake > > > > always seems to return a message that it is looking for a different > > > > controller. > > > > > For example, the URL entered into the parm field is '\vendors\view > > > > \105' > > > > > Here is what Cake is reporting for an error. > > > > > > > class VendorsController extends AppController { > > > > > var $name = 'Vendors'; > > > > > function viewG() { > > > > > } > > > > > } > > > > > ?> > > > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pass elements from one list to other one in HABTM
Any suggestion please? On 19 ene, 14:03, dandreta <[EMAIL PROTECTED]> wrote: > Hi! > I have an HABTM relation between ModelA and ModelB. > In the add view of A, I have created two lists(two multiple selects), > one with all B > elements of the database and other one empty . I pass elements of the > first list to the second one with javascript and the second list will > contain the B elements that will be related to the A element which I > am creating. > > The problem is that in order that controllerA obtains > the B elements of the second list I must select them with the mouse. > Then > it saves the relations ok. But, if I only pass elements to second list > (and I don't click them with the mouse) the relations do not save. > But, anyone knows how I can achieve that the elements of the second > list do not have to be selected with the mouse? > > Has anyone do something similar? > Any suggestion or help? > Thanks and regards --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Error editing a record without foreign key
? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using view from a parent controller
First, please specify your cake version, as it generally makes a huge difference if you're on 1.1 or 1.2. I'm going to assume you're on the 1.2 beta. If you want EVERY method in your ChildController to render the parent's view, it's easy-peasy class ChildController extends SomeParentController { function __construct() { parent::__construct(); $this->viewPath = 'some_parent'; // Look in app/views/some_parent/ xyz.ctp } } If it's only for certain actions, it gets a little trickier. You can set $this->viewPath in the action method itself, or in beforeRender(), based on certain conditions. If you need to only use the parent's view if the child's view folder doesn't contain the .ctp file, you're on your own. It's the view's responsibility to check if the template exists, not the controller's, so you're probably going to have to use a custom view. Hope this helps grigri On Jan 21, 3:57 pm, Tomka <[EMAIL PROTECTED]> wrote: > Hello. > > I wrote two controllers: > > ChildController extends ParentController > and > ParentController extends AppController > > If the action "foo" (which is defined in ParentController) is invoked > on the ParentController cake displays the view "parent/foo". > So far so good. > If the action "foo" is invoked on ChildController cake acts as I > suggested: the action from the parent class is invoked. But cake tries > to display the view "child/view". > How can I tell cake to display "parent/foo"? > I tried the render($action, $layout, $file) function but I do not > understand the parameters: I could get my view with $action = "parent/ > view" nor with anything in $file. > > Can anyone help me. > > Thanks in advance, > > Thomas --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using view from a parent controller
Hello. I wrote two controllers: ChildController extends ParentController and ParentController extends AppController If the action "foo" (which is defined in ParentController) is invoked on the ParentController cake displays the view "parent/foo". So far so good. If the action "foo" is invoked on ChildController cake acts as I suggested: the action from the parent class is invoked. But cake tries to display the view "child/view". How can I tell cake to display "parent/foo"? I tried the render($action, $layout, $file) function but I do not understand the parameters: I could get my view with $action = "parent/ view" nor with anything in $file. Can anyone help me. Thanks in advance, Thomas --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused using forms (i think!)
$html->selectTag() and friends are deprecated in 1.2 - do you mean 1.1? Anyway, here's how to do it: in 1.1: (I think. it's been a while) [controller] $this->set('usertypes', $this->User->Usertype->generateList()); [view] selectTag('User/usertype_id', $usertypes, $html->tagValue('User/usertype_id'), array(), array(), true); ?> in 1.2: [controller] $this->set('usertypes', $this->User->Usertype->find('list')); [view] select('User.usertype_id', $usertypes); ?> Note that the main problem here is both $html->selectTag and $form- >select take a (title => value) keyed array, and findAll() returns a full data array, numerically indexed. Model::generateList() and Model::find('list') generate exactly the type of array you need for a select form. Note that the displayed value of the Usertype model will be its $displayField value, which defaults to 'title' or 'name' if not set. If, for example, you wanted the Usertype's 'description' field to be displayed in the select, you'd have to do this: class Usertype extends AppModel { var $name = "Usertype"; var $displayField = "description"; // ... } I agree with hydra12 - use bake to see how it's done, then modify. On Jan 21, 4:33 pm, hydra12 <[EMAIL PROTECTED]> wrote: > I haven't ever tried this, but I think that $this->User->Usertype->find() > needs to be $this->User->Usertype->findAll() if you want to > > get a list of all the different user types. > > Best way to do this - use bake to make your views, then see how it > handles this. > > On Jan 19, 3:57 pm, judouk <[EMAIL PROTECTED]> wrote: > > > Sorry guys - another newbie question. > > > I've got an install of cake 1.2 > > I have a users table which I have associated with a usertypes table. > > > My database setup (cut down for simplicity) is; > > > create table usertypes ( > > id int(10) not null auto_increment, > > choice varchar(100) not null, > > ) type = myisam; > > > create table users ( > > id int(10) not null auto_increment, > > username varchar(15) not null, > > usertype_id int(10) not null, > > ) type = myisam ; > > > So, what I'm trying to do is to create a new view/controller to add a > > new user. > > However, I also want to use a selection of the usertypes. > > > I've gone through various applications (and thoroughly confused > > myself!) but have ended up creating two models; > > user.php > > > class User extends AppModel > > { > > var $name = 'User'; > > var $belongsTo = array( > > 'Usertype' => array( > > 'className' => 'Usertype', > > 'conditions' => '', > > 'order' => '', > > 'foreignKey' => 'usertype_id' > > ) > > ); > > > } > > > usertype.php > > > class Usertype extends AppModel > > { > > var $name = 'Usertype'; > > var $hasMany = array( > > 'User' => array( > > 'className' => 'User', > > 'conditions' => '', > > 'order' => '', > > 'foreignKey' => 'usertype_id' > > ) > > ); > > }; > > ?> > > > My controller (again, very much cut down) is > > > class UsersController extends AppController > > { > > var $name = 'Users'; > > var $helpers = array('Html', 'Form'); > > function register() > > { > > if (!empty($this->data)) > > { > > // i'll do some validation here > > } else { > > $this->set('usertypes', $this->User->Usertype->find()); > > $this->render(); > > } > > }} > > > ?> > > > I think the line which is wrong is > >$this->set('usertypes', $this->User->Usertype->find()); > > but I'm not sure. > > > Ultimately, I want to be able to do something like > > > > method="post"> > > > > labelTag('Users/usertype_id', > > 'Username'); ?> > > selectTag('Users/usertype_id', > > $usertypes, $html->tagValue('Users/usertype_id'), array(), array(), > > true); ?> > > tagErrorMsg('Users/usertype_id', 'Please > > select a user type.'); ?> > > > > > > submit('Add'); ?> > > > > > > > although this may be wrong too. > > > Hopefully, I've provided enough info (possibly too much). > > > Please help. > > > Thanks > > J --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 :: Database prefix and tips about sanitize
I could be wrong, but I don't think you have to do anything to use the database prefix. That's configured in database.php. On Jan 19, 1:21 pm, Josoroma <[EMAIL PROTECTED]> wrote: > I have an afterSave function inside a model, my two questions are: > > #1 How do i use the database prefix? > > #2 Do i need to sanitize $data['User']['username'] and $data['User'] > ['id']? > > Thanks in advance. > > function afterSave(){ > > $data = $this->read(); > $this->query('UPDATE `bm_aros` SET `alias` = \'' . $data['User'] > ['username'] . '\' WHERE `model` = \'User\' AND `foreign_key` = ' . > $data['User']['id']); > return true; > > } --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused using forms (i think!)
I haven't ever tried this, but I think that $this->User->Usertype- >find() needs to be $this->User->Usertype->findAll() if you want to get a list of all the different user types. Best way to do this - use bake to make your views, then see how it handles this. On Jan 19, 3:57 pm, judouk <[EMAIL PROTECTED]> wrote: > Sorry guys - another newbie question. > > I've got an install of cake 1.2 > I have a users table which I have associated with a usertypes table. > > My database setup (cut down for simplicity) is; > > create table usertypes ( > id int(10) not null auto_increment, > choice varchar(100) not null, > ) type = myisam; > > create table users ( > id int(10) not null auto_increment, > username varchar(15) not null, > usertype_id int(10) not null, > ) type = myisam ; > > So, what I'm trying to do is to create a new view/controller to add a > new user. > However, I also want to use a selection of the usertypes. > > I've gone through various applications (and thoroughly confused > myself!) but have ended up creating two models; > user.php > class User extends AppModel > { > var $name = 'User'; > var $belongsTo = array( > 'Usertype' => array( > 'className' => 'Usertype', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'usertype_id' > ) > ); > > } > > usertype.php >class Usertype extends AppModel > { > var $name = 'Usertype'; > var $hasMany = array( > 'User' => array( > 'className' => 'User', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'usertype_id' > ) > ); > }; > ?> > > My controller (again, very much cut down) is > class UsersController extends AppController > { > var $name = 'Users'; > var $helpers = array('Html', 'Form'); > function register() > { > if (!empty($this->data)) > { > // i'll do some validation here > } else { > $this->set('usertypes', $this->User->Usertype->find()); > $this->render(); > } > }} > > ?> > > I think the line which is wrong is >$this->set('usertypes', $this->User->Usertype->find()); > but I'm not sure. > > Ultimately, I want to be able to do something like > > method="post"> > > labelTag('Users/usertype_id', > 'Username'); ?> > selectTag('Users/usertype_id', > $usertypes, $html->tagValue('Users/usertype_id'), array(), array(), > true); ?> > tagErrorMsg('Users/usertype_id', 'Please > select a user type.'); ?> > > > submit('Add'); ?> > > > > although this may be wrong too. > > Hopefully, I've provided enough info (possibly too much). > > Please help. > > Thanks > J --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling one page from another
It should work, you have to set requestaction equal to a variable if you want the returned output, this is how I use it: $results = $this->requestAction('/controller/method'); Also, make sure that your method ends with: return($datayouwanttoreturn); You can also define the function in your method and setup a relation in your model (or at least a Uses relation). This is probably the better solution if you don't want the user to have direct access to the method your are calling (with request action, the user could put the path directly in the address bar and use it). When you have this relation setup you call the method like this: $results = $this->WhateverYourModelIs->WhateverTheModelYourCallingIs- >thefunctionyouwanttocall($passeddata); Dave On Jan 21, 9:19 am, MonkeyGirl <[EMAIL PROTECTED]> wrote: > Hi! > > I'm trying to run another controller's unrelated method from within > the method of the page being accessed, in the hope I might be able to > get all the variables it's setting to avoid code duplication. It looks > like requestAction can do this very thing, but I can't seem to get it > to output anything, even with array('return' => TRUE) as a second > parameter. > > I've looked at previous threads about the topic here, and although one > seemed to make reference to the answer I was looking for, it resided > on that Wiki that's no longer up. > > Is there any way to execute a different controller's different method > from within the relevant controller's relevant method? Am I on the > right track with how I'm going about it? > > Thanks! > Zoe. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple Bog tutorial Sorting question
findAll is a model function, so you can find it in the manual under models, or you can find it in the api under models. Don't feel bad if you have trouble finding things at first - we all do. As long as you make an honest effort to find things first, you'll find that the cake community is really great about helping point you in the right direction. hydra12 On Jan 20, 10:35 am, justradar <[EMAIL PROTECTED]> wrote: > ... but i guess i was likely searching for the WRONG vocabulary ... --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Setting $useDbConfig at runtime with cake 1.2 beta
Look at the values in $this->params (it's an array with all the parameters passed to the controller). If selenium is always the last parameter, you could check that, or you could just do: if(in_array('selenium', $this->params) { $this->useDbConfig='selenium'; } HTH! hydra12 On Jan 19, 11:58 pm, Steve Boyd <[EMAIL PROTECTED]> wrote: > Hey I'm wanting to use Selenium to do some functional testing and want > to use a separate database its own test data (essentially using this > database as a group of fixtures) > > I wanting use my urls like : /:controller/:action/:id/selenium > > idea being that when /selenium is present then my app => $useDbConfig > = 'selenium', otherwise just use 'default' > > currently i can get it to work with an exceptionally ugly hack from > within my parent model (all my other models extend this one) > > class TestableAppModel extends AppModel { > > function TestableAppModel() { > if > (preg_match('/\/selenium$/',$_SERVER['REQUEST_URI'])) { > $this->useDbConfig = 'selenium'; > } > $this->AppModel(); > } > > Anyone know of a nicer way to do this? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
David above identified the method that worked for me. Liberal echo pr($variable) in the models/controller/views was invaluable to me to work out what was getting passed by who and to where. Using Bake to build your scaffolding. You can learn an awful lot by looking at the baked code. Blogs & this group. Cake 1.2 is cutting edge and the documentation is always a step or two behind. Keep an eye open for CakePHP related blogs and posts as there are loads of posted code samples. You can bet, whatever your current problem is, someone, somewhere will have posted a solution. Read the Source: Digging into the source under the hood of cake will give you an insight into what cake is expecting and producing. It took me a good couple of weeks to 'get' CakePHP. Once that moment of enlightenment comes your productivity will skyrocket :-) Keep at it, immerse yourself in the Cake culture, read everything! On Jan 21, 4:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I think the most efficient way is to pick a project that interests > you, keep the manual handy and start developing. If it interests you, > you'll stick with it. > > Dave > > On Jan 21, 8:39 am, Baz <[EMAIL PROTECTED]> wrote: > > >http://tempdocs.cakephp.org/ > > > On Jan 21, 2008 8:54 AM, clemos <[EMAIL PROTECTED]> wrote: > > > > Hi Ben > > > > I think the very first step is to follow the "15 min Cake Blog Tutorial" > > >http://manual.cakephp.org/appendix/blog_tutorial > > > It allows you to setup a cake install, and build a very simple blog > > > engine with it, thus demonstrating Cake's basic concepts. > > > Once you're done with it, check out the rest of the manual to learn > > > more about all these concepts and other Cake features. > > > All this should be a good start... > > > > ++ > > > Clément > > > > On Jan 21, 2008 3:04 PM, Oxygen <[EMAIL PROTECTED]> wrote: > > > > > I've been playing around with CakePHP for a little over 24 hours in > > > > total now and I've just given up on the IBM "Cook up Web sites fast" > > > > tutorial; it was hopelessly buggy and inconsistent. I don't want to > > > > rant, and obviously some parts are out of date, but for this tutorial > > > > to be one of the suggested ways of getting started seems a little > > > > wrong. > > > > > I have a bad habit of sticking with a tutorial once I've started, I > > > > should probably have given up sooner, but I can't be alone in > > > > wondering what the most efficient way to get into CakePHP is. > > > > > Thanks, > > > > Ben Heley --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Calling one page from another
Hi! I'm trying to run another controller's unrelated method from within the method of the page being accessed, in the hope I might be able to get all the variables it's setting to avoid code duplication. It looks like requestAction can do this very thing, but I can't seem to get it to output anything, even with array('return' => TRUE) as a second parameter. I've looked at previous threads about the topic here, and although one seemed to make reference to the answer I was looking for, it resided on that Wiki that's no longer up. Is there any way to execute a different controller's different method from within the relevant controller's relevant method? Am I on the right track with how I'm going about it? Thanks! Zoe. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
I think the most efficient way is to pick a project that interests you, keep the manual handy and start developing. If it interests you, you'll stick with it. Dave On Jan 21, 8:39 am, Baz <[EMAIL PROTECTED]> wrote: > http://tempdocs.cakephp.org/ > > On Jan 21, 2008 8:54 AM, clemos <[EMAIL PROTECTED]> wrote: > > > > > Hi Ben > > > I think the very first step is to follow the "15 min Cake Blog Tutorial" > >http://manual.cakephp.org/appendix/blog_tutorial > > It allows you to setup a cake install, and build a very simple blog > > engine with it, thus demonstrating Cake's basic concepts. > > Once you're done with it, check out the rest of the manual to learn > > more about all these concepts and other Cake features. > > All this should be a good start... > > > ++ > > Clément > > > On Jan 21, 2008 3:04 PM, Oxygen <[EMAIL PROTECTED]> wrote: > > > > I've been playing around with CakePHP for a little over 24 hours in > > > total now and I've just given up on the IBM "Cook up Web sites fast" > > > tutorial; it was hopelessly buggy and inconsistent. I don't want to > > > rant, and obviously some parts are out of date, but for this tutorial > > > to be one of the suggested ways of getting started seems a little > > > wrong. > > > > I have a bad habit of sticking with a tutorial once I've started, I > > > should probably have given up sooner, but I can't be alone in > > > wondering what the most efficient way to get into CakePHP is. > > > > Thanks, > > > Ben Heley --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Version of cakephp
I like 1.2 better, they have fixed some bugs and added some cool features. You might want to check out this thread: http://groups.google.com/group/cake-php/browse_thread/thread/2ad48c4e10f58fc0/c7c4511051071b52#c7c4511051071b52 if you plan on using HABTM relations though. Dave On Jan 21, 9:04 am, "Davide" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Hi all, > > I'm newbe of cakephp, what version should I use? > > There are: > > # Stable: 1.1.19.6305 > > # Beta: 1.2.0.6311 > > > are there version compatible? I saw that in 1.1 template are .thtml, > > in 1.2 are .ctp. > > Can you correct me if I was wrong? > > I've never used 1.2 version but I think that thtml->ctp is > right. IMHO nowadays, by reading the mailing list, it should be almost > safe to use the 1.2 directly and since you are new and you have to > learn CakePHP I would advise you to start from 1.2 since many things > seems to be changed from the 1.1 and the 1.2. > > However, I remind, I've never used the 1.2 one and I may be wrong. > > Bye > Davide > > -- > Live life like you're gonna die. Because you're gonna. > William Shatner --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
question about phpThumb
Does anyone know how to disable the error images? If phpThumb ever errors out it turns the entire page into an image with the error on it. I'd like it to just not generate the thumb and keep parsing. I've tried setting $PHPTHUMB_CONFIG['disable_debug'] = true; in the phpThumb.config.php file but it doesn't seem to do anything. Thanks, Dave --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Model with no data source / database - how to do this in CakePHP 1.2?
I've got an application built in CakePHP 1.1 and I am having trouble in my attempts to port it to 1.2 as my models which had no data source / database are giving me errors. Back in version 1.1 if you wanted a model that didn't use the database you just set $useTable = false but this doesn't work in 1.2 as I get the error: Fatal Error (256): ConnectionManager::getDataSource - Non-existent data source default [CORE\cake\libs\model\connection_manager.php, line 113] Any tips? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Version of cakephp
[EMAIL PROTECTED] wrote: > > Hi all, > I'm newbe of cakephp, what version should I use? > There are: > # Stable: 1.1.19.6305 > # Beta: 1.2.0.6311 > > are there version compatible? I saw that in 1.1 template are .thtml, > in 1.2 are .ctp. > Can you correct me if I was wrong? I've never used 1.2 version but I think that thtml->ctp is right. IMHO nowadays, by reading the mailing list, it should be almost safe to use the 1.2 directly and since you are new and you have to learn CakePHP I would advise you to start from 1.2 since many things seems to be changed from the 1.1 and the 1.2. However, I remind, I've never used the 1.2 one and I may be wrong. Bye Davide -- Live life like you're gonna die. Because you're gonna. William Shatner --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Model with no data source / database - how to do this in CakePHP 1.2?
I've got an application built in CakePHP 1.1 and I am having trouble in my attempts to port it to 1.2 as my models which had no data source / database are giving me errors. Back in CakePHP if you want a model that didn't use the database you just set $useTable = false but this doesn't work in 1.2 as I get the error: Fatal Error (256): ConnectionManager::getDataSource - Non-existent data source default [CORE\cake\libs\model\connection_manager.php, line 113] Any tips? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
OK, a couple of things. First, I've never used DHTML Suite, but this works for me using extjs. I think it will work for you, too. First, try hard-coding your url: contentUrl: 'http://localhost/myapp/vendor/view/107' //or whatever your url is :-) Note: if you put localhost in, you have to call the site from localhost in your browser or you get permission denied errors on your ajax call. For example, my dev laptop is named tc-mark-lap. If I put localhost in my js code but try to call the code with http://tc-mark-lap/myapp/vendor/view/107 in my browser, it won't work. This will (I hope) fix your problem. You can check firebug to see what your ajax call returns (to make sure that your ajax is working even if there is a problem with your js code). In my code, I define a javascript variable in my default layout like this: var host = ''; In my javascript code, I put this for my ajax url: contentUrl: 'http://'+host+'/myapp/vendor/view/107' I hope that helps some. hydra12 On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > Here is the js code to generate the window > > > function createNewWindow() > { > var newWindowModel = new DHTMLSuite.windowModel( > {windowsTheme:false,id:'newWindow', > title:'New dynamically created window', > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > contentUrl:'vendor\view\107' } );\\this is the URL to load > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > newWindowWidget.init();} > > > Create window > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > Can you show the relevant js code? Specifically, how are you > > inputting the url? > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > application. I am using their Window Widget to retrieve some > > > information via AJAX. The issue is that it uses the URL as a > > > parameter when when you create the window from Javascript. Cake > > > always seems to return a message that it is looking for a different > > > controller. > > > > For example, the URL entered into the parm field is '\vendors\view > > > \105' > > > > Here is what Cake is reporting for an error. > > > > > class VendorsController extends AppController { > > > > var $name = 'Vendors'; > > > > function viewG() { > > > > } > > > > } > > > > ?> > > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Version of cakephp
Hi all, I'm newbe of cakephp, what version should I use? There are: # Stable: 1.1.19.6305 # Beta: 1.2.0.6311 are there version compatible? I saw that in 1.1 template are .thtml, in 1.2 are .ctp. Can you correct me if I was wrong? thanks all! Francesca --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
http://tempdocs.cakephp.org/ On Jan 21, 2008 8:54 AM, clemos <[EMAIL PROTECTED]> wrote: > > Hi Ben > > I think the very first step is to follow the "15 min Cake Blog Tutorial" > http://manual.cakephp.org/appendix/blog_tutorial > It allows you to setup a cake install, and build a very simple blog > engine with it, thus demonstrating Cake's basic concepts. > Once you're done with it, check out the rest of the manual to learn > more about all these concepts and other Cake features. > All this should be a good start... > > ++ > Clément > > On Jan 21, 2008 3:04 PM, Oxygen <[EMAIL PROTECTED]> wrote: > > > > I've been playing around with CakePHP for a little over 24 hours in > > total now and I've just given up on the IBM "Cook up Web sites fast" > > tutorial; it was hopelessly buggy and inconsistent. I don't want to > > rant, and obviously some parts are out of date, but for this tutorial > > to be one of the suggested ways of getting started seems a little > > wrong. > > > > I have a bad habit of sticking with a tutorial once I've started, I > > should probably have given up sooner, but I can't be alone in > > wondering what the most efficient way to get into CakePHP is. > > > > Thanks, > > Ben Heley > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
Here is the js code to generate the window function createNewWindow() { var newWindowModel = new DHTMLSuite.windowModel( {windowsTheme:false,id:'newWindow', title:'New dynamically created window', xPos:200,yPos:200,minWidth:400,minHeight:600 } ); newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', contentUrl:'vendor\view\107' } );\\this is the URL to load var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); newWindowWidget.init(); } Create window On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > Can you show the relevant js code? Specifically, how are you > inputting the url? > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > application. I am using their Window Widget to retrieve some > > information via AJAX. The issue is that it uses the URL as a > > parameter when when you create the window from Javascript. Cake > > always seems to return a message that it is looking for a different > > controller. > > > For example, the URL entered into the parm field is '\vendors\view > > \105' > > > Here is what Cake is reporting for an error. > > > class VendorsController extends AppController { > > > var $name = 'Vendors'; > > > function viewG() { > > > } > > > } > > > ?> > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can't find any services through AMF plugin
On Jan 21, 6:16 am, Grant Cox <[EMAIL PROTECTED]> wrote: > Well, I've never used the service browser, but the AMF plugin works > fine from Flex. Maybe I did rely it too much. So you didn't use any other tool to help developing applications combined with Flex and CakePHP? I'm not familiar with flex yet. > > Perhaps get on #cake-amf and check that the service browser is > supported - perhaps it uses something that is AMFPHP specific? I could use service browser when using CakeSWXPHP(the AMF part). I'll try to find more information through IRC. Thanks for your reply. :) --- kiang --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple "GROUP BY" ?
Thanks for your replies! @Claudia, I will try this! @Marcin I think an order by is not enough in this case. There are multiple entries with the same photo_id, but different descriptiontype_id's ... But at the end they are the same photos. Only in different categories (descriptiontypes). This structure is fixed by an webservice, so no possibility to change that fact. But i want to show them only once (it doesn't matter which category). So an simple ORDER would not prevent showing the same photo. I would use an DISTINCT, but i neet other informations too, so google said (:) I should rather use a GROUP BY clause... On 21 Jan., 12:03, Marcin Jaworski <[EMAIL PROTECTED]> wrote: > I don't see a reason for using grouping in this query. 'Group by' is > only needed if you want to use some aggregation functions like SUM, > AVG, MAX, MIN etc. If you don't use them, you don't need 'group by' in > your query. I think that use of 'order by' would be enough in your > situation, so you need to add an order value to findAll to order it by > photo_id. > > On 20 Sty, 23:10, cronet <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm siting here for about 2 hours and get it not work. I need a simple > > group by in an association. > > > This is in my controller: > > > $this->Hotel->bindModel( > >array('hasMany' => > > array( > > 'HotelDescriptionTranslation' => array( > > 'className' => > > 'HotelDescriptionTranslation', > > 'foreignKey' => > > 'hotel_id', > > 'conditions' => > > $cond1 > > > > ), > > 'HotelDescriptionPhoto' => array( > > 'className' => > > 'HotelDescriptionPhoto', > > 'foreignKey' => 'hotel_id', > > 'conditions' => > > $cond2 > > ) > > ) > > ), FALSE > > ); > > $hotel = $this->Hotel->findByHotelId($hotel_id); > > > Results in this query: > > > SELECT `HotelDescriptionPhoto`.`id`, > > `HotelDescriptionPhoto`.`descriptiontype_id`, > > `HotelDescriptionPhoto`.`hotel_id`, > > `HotelDescriptionPhoto`.`photo_id`, > > `HotelDescriptionPhoto`.`url_max300`, > > `HotelDescriptionPhoto`.`url_original`, > > `HotelDescriptionPhoto`.`url_square60`, > > `HotelDescriptionPhoto`.`created`, `HotelDescriptionPhoto`.`modified` > > FROM `hotel_description_photos` AS `HotelDescriptionPhoto` WHERE > > (descriptiontype_id = '5' OR descriptiontype_id = '10') AND > > `HotelDescriptionPhoto`.`hotel_id` IN (60160) > > > But I need a "GROUP BY `HotelDescriptionPhoto`.`photo_id`" inside the > > query... > > > Is there an easy(?!) way to achieve this? (I would not want to create > > a custom query)... > > > Regards, > > Alexander --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do people usually learn CakePHP and what is best?
Hi Ben I think the very first step is to follow the "15 min Cake Blog Tutorial" http://manual.cakephp.org/appendix/blog_tutorial It allows you to setup a cake install, and build a very simple blog engine with it, thus demonstrating Cake's basic concepts. Once you're done with it, check out the rest of the manual to learn more about all these concepts and other Cake features. All this should be a good start... ++ Clément On Jan 21, 2008 3:04 PM, Oxygen <[EMAIL PROTECTED]> wrote: > > I've been playing around with CakePHP for a little over 24 hours in > total now and I've just given up on the IBM "Cook up Web sites fast" > tutorial; it was hopelessly buggy and inconsistent. I don't want to > rant, and obviously some parts are out of date, but for this tutorial > to be one of the suggested ways of getting started seems a little > wrong. > > I have a bad habit of sticking with a tutorial once I've started, I > should probably have given up sooner, but I can't be alone in > wondering what the most efficient way to get into CakePHP is. > > Thanks, > Ben Heley > > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to get a Helper and a Component reuse the same code?
Ok, I have never regarded the vendors directory as a place to put my code. I have viewed it exclusively as a place for "external" libraries and PEAR stuff if needed. Your suggestion should work since neither component nor helper uses any cake functionality. They simply determine the current language and lookup and return the labels when they are requested. I'd better explain what I mean by problems using the helper for flashes. The following is what a normal setFlash looks liek now: $this->Session->setFlash( $this->Lang->show('save_ok') ); or for a flash using dynamic data: $this->Session->setFlash( sprintf( $this->Lang->show('save_ok'), 'some value', $this->Model->id) ); To use the helper in a flash-layout I would have to write something like: $this->Session->setFlash( $this->Lang->show('save_ok'), 'my_layout') ); not too bad but with a sprinted one: $this->Session->setFlash( $this->Lang->show('save_ok'), 'my_layout', array('args' =>array('some value',$this->Model->id)) ); And the flash-layout will have to take the values for sprintf() and pass them along. Since they can be one, two or more I have to make use of some php-feature I can't remember now to turn the array into arguments for the function. IMHO not a lot of fun :) I'd rather not go down this route. I hope that explains why I want to avoid making the setFlash more complex and put a lot of login in the flash-layout that really has nothing to do with flashing messages. To me taking "User %s was saved" and turning it into "User Martin was saved" does not belong in a layout. I have it in my controllers now but plan to more the whole thing into the language component/helper. thanks for your suggestion regarding the vendors dir. On Jan 21, 3:25 pm, nate <[EMAIL PROTECTED]> wrote: > The simplest way to do it would be to write a base class, stick it in > your vendors, and have the helper and component each extend it. This > is kind of cheating, but as long as your helper doesn't need any of > the Helper base class functionality, you should be good. > > As far as the setFlash bit, Im not 100% sure what you mean, but > sending your variables down to a custom flash layout should not result > in messy code by any means, unless I'm not understanding your > requirements here. > > On Jan 21, 8:07 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > OMG! I'm so sorry for the language in the top paragraph. > > Try this instead :) > > > "I am being picky about trying to keep things DRY and I would really > > like be able to have a component and a helper use the same code." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX Request - DHTML Suite
Can you show the relevant js code? Specifically, how are you inputting the url? On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > application. I am using their Window Widget to retrieve some > information via AJAX. The issue is that it uses the URL as a > parameter when when you create the window from Javascript. Cake > always seems to return a message that it is looking for a different > controller. > > For example, the URL entered into the parm field is '\vendors\view > \105' > > Here is what Cake is reporting for an error. > class VendorsController extends AppController { > > var $name = 'Vendors'; > > function viewG() { > > } > > } > > ?> > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
PostgreSQL Update Query and the trouble with aliases
I'm having trouble making UPDATE queries in PostgreSQL. I know that there is a known issue about Postgres not supporting aliases in UPDATE queries. Anyway, my problem is that when I try to create new Aro like this: $parent = $this->Acl->Aro->findByAlias('SuperUser'); $parentId = $parent['Aro']['id']; $this->Acl->Aro->create(); $this->Acl->Aro->save(array( 'foreign_key' => null, 'parent_id' => $parentId, 'alias' => 'User:30')); I get the following error: Warning (2): pg_query() [function.pg-query]: Query failed: ERROR: column "Aro" of relation "aros" does not exist LINE 1: UPDATE "aros" AS "Aro" SET "Aro"."lft" = "Aro"."lft" + 2 W... ^ [CORE\cake\libs\model\datasources \dbo\dbo_postgres.php, line 123] $sql= "UPDATE "aros" AS "Aro" SET "Aro"."lft" = "Aro"."lft" + 2 WHERE "Aro"."lft" >= '2'" I've already posted a bug to trac.cakephp.org... the reason for this message is that I would like to ask everybody for help on creating some quick solution or patch for this problem. P.S. This problem with aliases isn't just a one time thing, it is and will be happening until cakephp developers move the method renderStatement from dbo_source.php to each dbo file. It should work as it is, but it doesn't, they should all follow SQL standards but they don't. So, my suggestion is to make renderStatement in every dbo. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How do people usually learn CakePHP and what is best?
I've been playing around with CakePHP for a little over 24 hours in total now and I've just given up on the IBM "Cook up Web sites fast" tutorial; it was hopelessly buggy and inconsistent. I don't want to rant, and obviously some parts are out of date, but for this tutorial to be one of the suggested ways of getting started seems a little wrong. I have a bad habit of sticking with a tutorial once I've started, I should probably have given up sooner, but I can't be alone in wondering what the most efficient way to get into CakePHP is. Thanks, Ben Heley --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 beta, How to add metalanguage support in my application?
http://groups.google.com/group/cake-php/web/frequent-discussions Go to section "How to add i18n support?" On 21 jan, 11:40, ali <[EMAIL PROTECTED]> wrote: > Can any body tell me in detail, how I can add multi language support > in application. I am newby to cakephp. Please help me in this regard, > > thanks, --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to get a Helper and a Component reuse the same code?
The simplest way to do it would be to write a base class, stick it in your vendors, and have the helper and component each extend it. This is kind of cheating, but as long as your helper doesn't need any of the Helper base class functionality, you should be good. As far as the setFlash bit, Im not 100% sure what you mean, but sending your variables down to a custom flash layout should not result in messy code by any means, unless I'm not understanding your requirements here. On Jan 21, 8:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > OMG! I'm so sorry for the language in the top paragraph. > Try this instead :) > > "I am being picky about trying to keep things DRY and I would really > like be able to have a component and a helper use the same code." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX Request - DHTML Suite
I am looking at using the DHTML Suite (dhtmlgoodies.com) with my application. I am using their Window Widget to retrieve some information via AJAX. The issue is that it uses the URL as a parameter when when you create the window from Javascript. Cake always seems to return a message that it is looking for a different controller. For example, the URL entered into the parm field is '\vendors\view \105' Here is what Cake is reporting for an error. Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help - problem with Cakephp + phpFlickr authenticated sessions
I posted this on the phpFlickr forum, but thought I might also try here: http://phpflickr.com/forums/comments.php?DiscussionID=241 My problem is getting an "authenticated" session with phpFlickr so I can access private photos. It seems to get stuck in a redirect loop. Has anyone managed to get this to work -- either with phpFlickr or some other library? TIA. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Passing ID (MySQL) from one table to the next
Hi All, I am working on an application that uses a Primary Key 'ID'. This ID is based on Table A. Another portion of this application needs to use the ID for Table B. My question is how would I pass that ID (from Table A) in a form to a newly added item in Table B? I was thinking of this. I have one form that the user selects the 'Vendor' (Table A), then that posts to another form 'addPart' (Table B), but I have not figured out how to get the Vendor ID to the Part Form. //selects a vendor to the database function add() { $this->set('vendors', $this->Vendor->findAll()); } //Adds the part to database. function addPart() { if (!empty($this->data)) { $this->$id = $_POST["id"]; //tried this to get ID if ($this->Part->save($this->data)) { $this->Session->setFlash('You have added a new part successfully.'); $this->redirect('/parts/index'); } } } This is obviously a new guy question, but I have searched all over the place and could not find a clear answer. Any help would be appreciated. Thank you! --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SQL Error: 1110: Column 'id' specified twice with Scaffolding
I have a similar problem. Different table but same process/scenario. The only additional data point I can add is that this only occurs if I try to use the automagic UUID feature, that is if I specify the id column as char(36) not null primary key. When I use int(11) not null auto_increment primary key, it works as expected. Roger On Jan 14, 2:34 pm, JTTACJ1 <[EMAIL PROTECTED]> wrote: > I'm getting ready to explore AJAX so I created what I thought was the > most basic application possible. It is a task manager with one table > consisting of two columns. Just to get things up and running quickly > I created the model and a controller using scaffolding. When creating > a new entry int the task table I get the error: > > Warning (512): SQL Error: 1110:Column'id'specifiedtwice[CORE\cake > \libs\model\datasources\dbo_source.php, line 440] > > Checked trac and didn't find it listed. This makes me think I did > something wrong even if the application to this point seems to simple > to have any problems. Is this an unreported bug or something I am > doing wrong? > > James > > CREATE TABLE `tasks` ( > `id` char(36) NOT NULL, > `name` varchar(50) NOT NULL, > PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=latin1; > > class Task extends AppModel { > > public $name = 'Task'; > > } > > class TasksController extends AppController { > public $scaffold; > > } --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cakephp 1.2 beta, How to add metalanguage support in my application?
Can any body tell me in detail, how I can add multi language support in application. I am newby to cakephp. Please help me in this regard, thanks, --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Paginate an array thats not from a model
Hi Chris, Here's a simple solution I use for myself (I don't use XML, but I use it for a search function) $xmlData = [read the xmlfeed and return it as an array] /* run through the array */ foreach($xmlData as $key => $val) { /* the value will be sortable by the key */ $this->pagination[$key] = $val; } $this->set('result', $this->paginate()); I hope this will help you out! Johan de Jong On 18 jan, 22:05, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 18, 2008 1:54 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > Why are you using MVC if you aren't making models? > > It's not about not using models, it's about using non-database powered models. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to get a Helper and a Component reuse the same code?
OMG! I'm so sorry for the language in the top paragraph. Try this instead :) "I am being picky about trying to keep things DRY and I would really like be able to have a component and a helper use the same code." --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to get a Helper and a Component reuse the same code?
I am being picky about trying to keep things DRY but I would really be able to have a component and a helper use the same code. In v1.1 I could "cheat" by letting the helper pass along calls to $this- >controller->MyComponent. In 1.2 this is no longer possible (AFAIK). I have read other threads on this subject. Most of the answers were variations of "controllers shouldn't ever use Helper functionality". I agree but I think my situation is one where it is valid. Or at least the code I have put in a Helper and a Component must be accessed from both controllers and views. I am using the very simplest form of language support. An array of named labels and messages defined in a number of files (one for each language). Very basic but enough for now. A LanguageComponent needs to be present to handle Flash-messages. A LanguageHelper needs to be present for normal insertion into pages and elements. Since every last bit of code in these two are identical (apart from the name of the classes) I would like to get around the duplication. The code is simple now but I will probably change how it works as I need to during development. I then have to remember to make the same alterations in two places. something I frequently forget. Looking at the "internal" components and helpers. E.g. the Sesson pair. I see that they include common functionality by uses(). This includes any file in cake/libs/. Is there, or may we please have, a similar function that cal include an application-specific "libs" directory? The workarounds I know of, all seem a bit dodgy: - include / require all the code between the classes {} from file. - put the code in a vendor directory I don't have a handle on the new plugins system yet but it looks like it was designed for something quite different? And: No. I can't let a custom Flash message layout call the LanguageHelper. Some messages need to be "sprinted" to include dynamic data. Doing that via the Flash layout would result in some pretty messy code with each setFlash() in the controllers if I could even get it to work properly. Any ideas you can share that could help me out with this problem? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pagination
Have you read the second page of the article you were referring to? There are links to online demos by AD7Six in it. Anyways, I think the answer you're looking for can be found here: http://www.ad7six.com/Pagination/Named Use the 'show' param and make sure it's not listed in 'privateParams'. HTH On 21 Ян, 11:01, bhushan A <[EMAIL PROTECTED]> wrote: > I have followed steps as per > linkhttp://bakery.cakephp.org/articles/view/pagination.Paginationis achieved > but its displying Result per page = 20 by > default. I want to take that from user. There is one function > resultPerPageSelect() in view/helper/pagination.php . We have to call > it in views/elements/pagination.thtml. But i am not getting how to > call it. Please suggest some way to achieve this. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple "GROUP BY" ?
I don't see a reason for using grouping in this query. 'Group by' is only needed if you want to use some aggregation functions like SUM, AVG, MAX, MIN etc. If you don't use them, you don't need 'group by' in your query. I think that use of 'order by' would be enough in your situation, so you need to add an order value to findAll to order it by photo_id. On 20 Sty, 23:10, cronet <[EMAIL PROTECTED]> wrote: > Hi, > > I'm siting here for about 2 hours and get it not work. I need a simple > group by in an association. > > This is in my controller: > > $this->Hotel->bindModel( >array('hasMany' => > array( > 'HotelDescriptionTranslation' => array( > 'className' => > 'HotelDescriptionTranslation', > 'foreignKey' => > 'hotel_id', > 'conditions' => $cond1 > > ), > 'HotelDescriptionPhoto' => array( > 'className' => > 'HotelDescriptionPhoto', > 'foreignKey' => 'hotel_id', > 'conditions' => > $cond2 >) > ) > ), FALSE > ); > $hotel = $this->Hotel->findByHotelId($hotel_id); > > Results in this query: > > SELECT `HotelDescriptionPhoto`.`id`, > `HotelDescriptionPhoto`.`descriptiontype_id`, > `HotelDescriptionPhoto`.`hotel_id`, > `HotelDescriptionPhoto`.`photo_id`, > `HotelDescriptionPhoto`.`url_max300`, > `HotelDescriptionPhoto`.`url_original`, > `HotelDescriptionPhoto`.`url_square60`, > `HotelDescriptionPhoto`.`created`, `HotelDescriptionPhoto`.`modified` > FROM `hotel_description_photos` AS `HotelDescriptionPhoto` WHERE > (descriptiontype_id = '5' OR descriptiontype_id = '10') AND > `HotelDescriptionPhoto`.`hotel_id` IN (60160) > > But I need a "GROUP BY `HotelDescriptionPhoto`.`photo_id`" inside the > query... > > Is there an easy(?!) way to achieve this? (I would not want to create > a custom query)... > > Regards, > Alexander --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple binding question.
Do bind in the model you will execute the findAll! As you say: A deal has many tickets, and belongs to one item. do bind: Deal hasMany Ticket, Deal belongsTo Item. HTH, - Dardo Sordi. On Jan 21, 2008 7:16 AM, phpjoy <[EMAIL PROTECTED]> wrote: > > for some kind of reason, this didn't work: > $this->Ticket->bindModel(array('belongsTo' => array('Deal' > =>array('foreignKey' => 'deal_id'; > $this->Ticket->Deal->bindModel(array('belongsTo' => array('Item' > =>array('foreignKey' => 'item_id'; > > On the query, it searched for: > Item.id = Ticket.item_id (and item_id doesn't exist) > > On Jan 20, 11:17 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> > wrote: > > If "A deal has many tickets, and belongs to one item.", then why you bind: > > > > $this->Ticket->bindModel(array('belongsTo' => array('Deal' > > =>array('foreignKey' => 'deal_id'; > > $this->Ticket->bindModel(array('belongsTo' => array('Item' > > =>array('foreignKey' => 'deal_id'; > > > > Ticket belongsTo Deal, Ticket belongsTo Item ? > > > > > On Jan 19, 2008 6:43 PM, phpjoy <[EMAIL PROTECTED]> wrote: > > > > > > > > > No, there isn't such a key Ticket.item_id > > > Warning (512): SQL Error: 1054: Unknown column 'Ticket.item_id' in 'on > > > clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 440] > > > > > There's Deal.item_id > > > Basically a ticket belongs to a deal. A deal has many tickets, and > > > belongs to one item. > > > > > It should be: > > > Ticket->Deal->Item > > > > > I need to get Item.title for every ticket that I have. > > > So my custom SQL query is correct, but I wonder how I could use binds > > > to do that. > > > > > That's the custom query I came up with: > > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Deal`.`item_id` = > > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > > When I left join 'items' to deal.item_id, it works. > > > > > On Jan 19, 6:40 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > > > > You are putting: > > > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > > array('foreignKey' => 'deal_id'; > > > > > > instead of : > > > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > > array('foreignKey' => 'item_id'; > > > > > > it's a copy and paste error. > > > > > > HTH, > > > > - Dardo Sordi. > > > > > > On Jan 18, 2008 9:39 PM, phpjoy <[EMAIL PROTECTED]> wrote: > > > > > > > I wonder how I could make a simple query to work through bind(), and > > > > > not use a custom query. > > > > > > > I'm binding two models for a model: > > > > > $this->Ticket->bindModel(array('belongsTo' => array('Deal' => > > > > > array('foreignKey' => 'deal_id'; > > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > > > array('foreignKey' => 'deal_id'; > > > > > > > The resulting query I get is this: > > > > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > > > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > > > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Ticket`.`deal_id` = > > > > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > > > > > > Now, instead of: > > > > > `Item` ON (`Ticket`.`deal_id` = `Item`.`id`) > > > > > I need: > > > > > `Item` ON (`Deal`.`item_id` = `Item`.`id`) > > > > > > > Which gives this query: > > > > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > > > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > > > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Deal`.`item_id` = > > > > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > > > > > > I tried binding item to deal, and CakePHP made 200 queries instead. > > > > > That didn't work too well. > > > > > Any ideas how I could make a slim query with CakePHP, without using > > > > > query()? > > > --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple binding question.
for some kind of reason, this didn't work: $this->Ticket->bindModel(array('belongsTo' => array('Deal' =>array('foreignKey' => 'deal_id'; $this->Ticket->Deal->bindModel(array('belongsTo' => array('Item' =>array('foreignKey' => 'item_id'; On the query, it searched for: Item.id = Ticket.item_id (and item_id doesn't exist) On Jan 20, 11:17 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > If "A deal has many tickets, and belongs to one item.", then why you bind: > > $this->Ticket->bindModel(array('belongsTo' => array('Deal' > =>array('foreignKey' => 'deal_id'; > $this->Ticket->bindModel(array('belongsTo' => array('Item' > =>array('foreignKey' => 'deal_id'; > > Ticket belongsTo Deal, Ticket belongsTo Item ? > > On Jan 19, 2008 6:43 PM, phpjoy <[EMAIL PROTECTED]> wrote: > > > > > No, there isn't such a key Ticket.item_id > > Warning (512): SQL Error: 1054: Unknown column 'Ticket.item_id' in 'on > > clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 440] > > > There's Deal.item_id > > Basically a ticket belongs to a deal. A deal has many tickets, and > > belongs to one item. > > > It should be: > > Ticket->Deal->Item > > > I need to get Item.title for every ticket that I have. > > So my custom SQL query is correct, but I wonder how I could use binds > > to do that. > > > That's the custom query I came up with: > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Deal`.`item_id` = > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > When I left join 'items' to deal.item_id, it works. > > > On Jan 19, 6:40 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > > > You are putting: > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > array('foreignKey' => 'deal_id'; > > > > instead of : > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > array('foreignKey' => 'item_id'; > > > > it's a copy and paste error. > > > > HTH, > > > - Dardo Sordi. > > > > On Jan 18, 2008 9:39 PM, phpjoy <[EMAIL PROTECTED]> wrote: > > > > > I wonder how I could make a simple query to work through bind(), and > > > > not use a custom query. > > > > > I'm binding two models for a model: > > > > $this->Ticket->bindModel(array('belongsTo' => array('Deal' => > > > > array('foreignKey' => 'deal_id'; > > > > $this->Ticket->bindModel(array('belongsTo' => array('Item' => > > > > array('foreignKey' => 'deal_id'; > > > > > The resulting query I get is this: > > > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Ticket`.`deal_id` = > > > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > > > > Now, instead of: > > > > `Item` ON (`Ticket`.`deal_id` = `Item`.`id`) > > > > I need: > > > > `Item` ON (`Deal`.`item_id` = `Item`.`id`) > > > > > Which gives this query: > > > > SELECT `Ticket`.`id`, `Deal`.`file`, `Item`.`title` FROM `tickets` AS > > > > `Ticket` LEFT JOIN `deals` AS `Deal` ON (`Ticket`.`deal_id` = > > > > `Deal`.`id`) LEFT JOIN `items` AS `Item` ON (`Deal`.`item_id` = > > > > `Item`.`id`) WHERE `Ticket`.`user_id` = 1 > > > > > I tried binding item to deal, and CakePHP made 200 queries instead. > > > > That didn't work too well. > > > > Any ideas how I could make a slim query with CakePHP, without using > > > > query()? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dynamic form creation?
I did the following while working on a dynamic questionnaires generation system. 1 Questionnaire hasMany Questions 1 Question has Many options (for multiple answers) --- ANSWERS -- 1 Questionnaire hasMany AnswersMain 1 AnswerMain hasMany Answers AnswerMain has: - id - questionnaire_id - user_id Answers has: - id - answermain_id - question_id - user_id To create the questionnaire I used Javascript (jQuery) to dynamically generate the several options fields for a question Dan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dynamic form creation?
I did the following while working on a dynamic questionnaires generation system. 1 Questionnaire hasMany Questions 1 Question has Many options (for multiple answers) --- ANSWERS -- 1 Questionnaire hasMany AnswersMain 1 AnswerMain hasMany Answers AnswerMain has: - id - questionnaire_id - user_id Answers has: - id - answermain_id - question_id - user_id To create the questionnaire I used Javascript (jQuery) to dynamically generate the several options fields for a question Dan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple "GROUP BY" ?
Hi there Something like this might work (untested): $conditionsArr = array('HotelDescriptionPhoto.hotel_id' => $hotel_id, '1=1 GROUP BY HotelDescriptionPhoto.photo_id'); $hotel = $this->Hotel->findAll($conditionsArr); Although you should make sure that you really need a group by - grouping by one column when selecting multiple columns often yields arbitrary results. Good luck Claudia On Jan 20, 11:10 pm, cronet <[EMAIL PROTECTED]> wrote: > Hi, > > I'm siting here for about 2 hours and get it not work. I need a simple > group by in an association. > > This is in my controller: > > $this->Hotel->bindModel( >array('hasMany' => > array( > 'HotelDescriptionTranslation' => array( > 'className' => > 'HotelDescriptionTranslation', > 'foreignKey' => > 'hotel_id', > 'conditions' => $cond1 > > ), > 'HotelDescriptionPhoto' => array( > 'className' => > 'HotelDescriptionPhoto', > 'foreignKey' => 'hotel_id', > 'conditions' => > $cond2 >) > ) > ), FALSE > ); > $hotel = $this->Hotel->findByHotelId($hotel_id); > > Results in this query: > > SELECT `HotelDescriptionPhoto`.`id`, > `HotelDescriptionPhoto`.`descriptiontype_id`, > `HotelDescriptionPhoto`.`hotel_id`, > `HotelDescriptionPhoto`.`photo_id`, > `HotelDescriptionPhoto`.`url_max300`, > `HotelDescriptionPhoto`.`url_original`, > `HotelDescriptionPhoto`.`url_square60`, > `HotelDescriptionPhoto`.`created`, `HotelDescriptionPhoto`.`modified` > FROM `hotel_description_photos` AS `HotelDescriptionPhoto` WHERE > (descriptiontype_id = '5' OR descriptiontype_id = '10') AND > `HotelDescriptionPhoto`.`hotel_id` IN (60160) > > But I need a "GROUP BY `HotelDescriptionPhoto`.`photo_id`" inside the > query... > > Is there an easy(?!) way to achieve this? (I would not want to create > a custom query)... > > Regards, > Alexander --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Pagination
I have followed steps as per link http://bakery.cakephp.org/articles/view/pagination. Pagination is achieved but its displying Result per page = 20 by default. I want to take that from user. There is one function resultPerPageSelect() in view/helper/pagination.php . We have to call it in views/elements/pagination.thtml. But i am not getting how to call it. Please suggest some way to achieve this. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: database.php: $test?
The test database is simply a temporary database used in unit tests that require a database to run. Say you want to write a test that involves some custom SQL or simply some condition of ordering logic in your model. To be able to run such a test you need an actual database (that you fill with some data to test for). The point is that you would not want a failed test (or a successful one) to delete lots of data in your normal development database (or god forbid production database). When testing for stored passwords in a user table you don't want your "normal" user-accounts affected by the tests. As for best practices (how to setup, fill and empty the database and such things) I am no authority. I still still mess about with these things quite manually. On Jan 21, 6:38 am, 703designs <[EMAIL PROTECTED]> wrote: > What are good practices for configuring a test database, as defined in > database.php.default's second array? I know that it is unnecessary, > but is it advised to have a test db? --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---