Re: Threaded count
I know that, product_count is the counter_cache, but only for the subcategories the ones that have a parent_id from the categories, is a threaded model, and when i select the main categories i want to know the count of the products in all the subcategories :). That's my dilemma. Thx. On Thu, 2009-05-14 at 13:47 -0700, majna wrote: there is counter cache counter_cache property. check manual. On May 14, 4:41 pm, Bogdan I. Bursuc bogdanbursu...@gmail.com wrote: I have the following model: categories: - id, - parent_id, - name, - product_count So, the model is threaded: exists main categories and subcategories that's it, but only subcategories contain products so only for subcategories product_count will be incremented. My question: Is there a way in cake so that when i do a find on the main categories to obtain the number of products in all it's subcategories. Thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.
Any idea why this would be happening? The session section of my conf: /** * The preferred session handling method. Valid values: * * 'php'Uses settings defined in your php.ini. * 'cake' Saves session files in CakePHP's /tmp directory. * 'database' Uses CakePHP's database sessions. * * To define a custom session handler, save it at /app/config/ name.php. * Set the value of 'Session.save' to name to utilize it in CakePHP. * * To use database sessions, execute the SQL file found at /app/config/ sql/sessions.sql. * */ Configure::write('Session.save', 'php'); /** * The name of the table used to store CakePHP database sessions. * * 'Session.save' must be set to 'database' in order to utilize this constant. * * The table name set here should *not* include any table prefix defined elsewhere. */ //Configure::write('Session.table', 'cake_sessions'); /** * The DATABASE_CONFIG::$var to use for database session handling. * * 'Session.save' must be set to 'database' in order to utilize this constant. */ //Configure::write('Session.database', 'default'); /** * The name of CakePHP's session cookie. */ Configure::write('Session.cookie', 'CAKEPHP'); /** * Session time out time (in seconds). * Actual value depends on 'Security.level' setting. */ Configure::write('Session.timeout', '120'); /** * If set to false, sessions are not automatically started. */ Configure::write('Session.start', true); /** * When set to false, HTTP_USER_AGENT will not be checked * in the session */ Configure::write('Session.checkAgent', true); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
On May 15, 5:58 am, Mr-Yellow meisteryel...@gmail.com wrote: Anyone want to place bets on how long it is before the tickets are deleted and ignored? How about we place bets on how long until: 1) You create them in the right place 2) You submit patches AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
On May 15, 8:56 am, AD7six andydawso...@gmail.com wrote: On May 15, 5:58 am, Mr-Yellow meisteryel...@gmail.com wrote: Anyone want to place bets on how long it is before the tickets are deleted and ignored? How about we place bets on how long until: 1) You create them in the right place 2) You submit patches Btw. works fine for me with: IE6 windowsxp FF3 linux FF3.0/FF3.5 so most likely a good idea to link to some screenshots to justify the need for the css patches you're going to submit (here: http://thechaw.com/api_generator/tickets) AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Question about how manage particular data in session
I identify the service by url but only at the access point of service but in the subsequent action I can't identify the service by url unless I keep the service_id in the url (for example in GET) but I would like to avoid that otherwise I have to review all code On 15 Mag, 03:40, Dr. Loboto drlob...@gmail.com wrote: Service should be identified by URL. Session should only identify user, regardless of service. On May 14, 6:17 pm, byqsri marco.rizze...@gmail.com wrote: Why the design of such application is wrong initially? How can I manage many services from a single portal? On 14 Mag, 10:15, Dr. Loboto drlob...@gmail.com wrote: Yes, there are a lot of problems as whole design of such application is wrong initially. On May 14, 2:25 pm, byqsri marco.rizze...@gmail.com wrote: And you suppose that in a page I have some simultaneous ajax call? With this system I lost the right referer whene these ajax calls happen On 14 Mag, 09:21, byqsri marco.rizze...@gmail.com wrote: Ok But you suppose that user (with page1 and page2 opened) clicks another link on page1 that opens page3 how can I to know that page3 is relative to the service of page1 (in session I have page2 = $service_id and not page1 = $service_id ) On 14 Mag, 05:02, Dr. Loboto drlob...@gmail.com wrote: Example of this approach: 1. User visit index page and click on some page1 link. You receive request for that page1 - you know service_id (for example it is 5) and referer points to index, so you save initial page1 = $service_id to session. 2. On that page user follow next link page2. You receive request for page2 - referer points to page1 and you search for this key in session, find there service_id (= 5), remove this record from session and save next one - page2 = $service_id 3. And so on... 4. User open new index page in other browser window and click on page10 link. Same situation as in #1, but you save page10 = $new_service_id (for example, 125) to session and receive new chain to track. User session in this case contain as much records url = service_id as much times he started from index. On each page reload by user you re-write corresponding record in session. We use this to give user prev/next navigation through search results without changing target pages URLs. On May 13, 6:20 pm, byqsri marco.rizze...@gmail.com wrote: Sorry but in this way I must keep in session all pages the user load with relative service_id? On 13 Mag, 05:34, Dr. Loboto drlob...@gmail.com wrote: You should save service_id in session as associative array: current_url = service_id. When your controller/action is requested, search service_id in session by $this-referer() key. You also should be always aware that referrer or session will be empty and be able to act normally in this case too. On May 12, 10:39 pm, byqsri marco.rizze...@gmail.com wrote: On 12 Mag, 17:02, brian bally.z...@gmail.com wrote: On Tue, May 12, 2009 at 4:33 AM, byqsri marco.rizze...@gmail.com wrote: Ok But how can I know which service is active in a particular moment? You could make the service_ids the array keys with a value of false, except the active one. I can't to do this because I can have some controller/action that is requested in many services. I must keep an information of active service in the session --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: No ID returning from the model when inserting new record
Yes I tried that and it didn't work had the same problem as if I did $this-Document-id, would return the id only on saving an existing document not on saving a new Document --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Routes regarding - e-book by Matt Curry
I didn't work with it yet but afaik 'prefix' = 'admin' On May 15, 12:57 am, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: In the section regarding the add / edit functions in 1 he has the routes Router::connect('/:controller/add', array('action' = 'edit')); How would you configure this for the admin routing? I tried Router::connect('/:controller/add', array('action' = 'edit')); or Router::connect('/:controller/add', array('action' = 'edit', 'admin' = true)); Or Router::connect('/admin/:controller/add', array('action' = 'edit')); And nothing...if I attempted to go to add in the url page not found...did not connect me to edit. Ideas? -Original Message- From: Nate [mailto:nate.ab...@gmail.com] Sent: May-14-09 5:36 AM To: CakePHP Subject: FREE CakePHP e-book by Matt Curry Hey everyone, Matt Curry (of CakePHP Digest fame) has just published a *free* e-book on advanced development techniques with CakePHP. If you're already a seasoned Cake developer, this book will help you pick up many new tricks and best-practice solutions, as well as highlighting many little-known framework features. Read all about it here:http://www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-su... some-advanced-cakephp-tips/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $useTable ignored when using bindModel()?
I found my error! I was using plugin architecture so the model's correct name is plugin_name(dot)model_name!!! Thanks to all! Bye! On 13 Mag, 21:57, deefens steff.muel...@gmail.com wrote: Dr. Loboto, you saved my day. Thank you so much, now its working properly @MPeg: check your model-filenames, in my situation this was the fault On 13 Mai, 10:28, MPeg marco.pegor...@gmail.com wrote: Hi, I have the same problem in my application: useTable it seems to be ignored. I use a model's class in his own controller correctly so I think Cake is able to load it via naming convenctions correctly to! I think so but Cake still ignore mi configuration in relations! What to do? I hate to rename tables to follow cake conventions... i use some area- prefix to mantain order into db tables! On May 13, 5:46 am, Dr. Loboto drlob...@gmail.com wrote: Check filename of ActivitiesHostess model, it should be activities_hostess.php Such error will occur if Cake is unable to find your model file and load generic model that assume conventional table name. On May 13, 1:01 am, deefens steff.muel...@gmail.com wrote: hi john, it still doesn't work. i get the same message again: Error: Database table activities_hostesses for model ActivitiesHostess was not found :( On 12 Mai, 09:47, John Andersen j.andersen...@gmail.com wrote: If I understand what I read from the source, then your code should be: ... bindModel( array( 'hasOne' = array('ActivitiesHostess' = array ('ActivitiesHostess') ) ), false )' Thus your models name should be used as the name for the model that CakePHP thinks it has to use (inflected etc)! Enjoy, John On May 12, 9:07 am, deefens steff.muel...@gmail.com wrote: nobody familar with this? *hope* On 9 Mai, 09:16, deefens steff.muel...@gmail.com wrote: Hi guys, this is driving me nuts: when i use bindModel() to add a relationship on the fly to an certain model, it seems that cake ignores the table name specified in the attached model in var $useTable. Example: class ActivitiesHostess extends AppModel { var $name = 'ActivitiesHostess'; var $useTable = 'v_activities_hostess'; var $belongsTo = array('Activity', 'Hostess'); } this is my added relationship class, providing one girl per activity (don't mess, thats a harmless website smile.gif. so i attach this on the fly in the hostess controller: $url['activity']?$this-Hostess-bindModel(array('hasOne'=array ('ActivitiesHostess' = array())), false):''; but then, after clearing the cache and reload the website cake says: Error: Database table activities_hostesses for model ActivitiesHostess was not found. but in the model i specified the table name as v_activities_hostess (it's a view). has anyone any explanation for this or a workaround to avoid cake aborting here? googled half the world, but didn't have any success... any hints are very appreciated --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM relation with custom named table
I found my error! I was using plugin architecture so the model's correct name is plugin_name(dot)model_name!!! Please read this thread about this problem: http://groups.google.it/group/cake-php/browse_thread/thread/8c750cd28f43225b?hl=it Thanks to all! Bye! On 12 Mag, 09:11, MPeg marco.pegor...@gmail.com wrote: Hi to all bakers! I'm diving into Cake1.2 relations while building a demo ACL application (Just to learn about...) I'm creating a custom plugin to solve this issue so my tables have a custom name just to mantain order into db: Model Yuser - Table freyr_users Model Ypermission - Table freyr_permissions I built a join_table like: Table name: freyr_objects_permissions object_id | bigint (16) permission_id | bigint (16) I have set up my Yuser - YPermission HABTM relation this way: var $hasAndBelongsToMany = array( 'Ypermission' = array( 'className' = 'Ypermission', 'joinTable' = 'freyr_objects_permissions', 'foreignKey' = 'object_id', 'associationForeignKey' = 'permission_id', ), ); This relation causes a missing table error because Ypermission model try to use a table named ypermissions (just using naming conventions)... It seems to ignore the useTable directive set into model. I have temporary solved this problem just renaming freyr_ypermissions into ypermissions but I want to use custom table names to maintain order in my db! Tables grows up every day --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Poll: what do you hate about CakePHP?
- No virtual fields support On 8 Mag, 00:29, Nate nate.ab...@gmail.com wrote: Well, maybe hate's a strong word. Let's say, what do you like the least? Kind of an odd question, I know, but since we've kick-started development of a new version, I'd like to know what the most frustrating things with the framework are, even if they're things we can't fix right away. I'll get us started: PHP 4 support. Who's next? TIA for the input. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
LOL IE support. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
last_login update
Hi Cake people, I have spent much time in make this work but nothing.I am using auth which is working ok and i want to update the last_login field in users table.But i can't.Most of my attempts lead to create a new row in table with an empty user contained the updated field.I have read all of the previous posts here but nothing help me.Can you tell me if I do something wrong.Here i put my code: app_controller: class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { $this-Auth-loginAction = array('controller' = 'users', 'action' = 'login'); $this-Auth-logoutRedirect = array('controller' = 'users', 'action' = 'login'); $this-Auth-loginRedirect = array('controller' = 'users', 'action' = 'index'); $this-Auth-loginError=__('Invalid username or password',true); $this-Auth-authorize='controller'; } function isAuthorized(){ return true; } } users_controller: login action function login() { $this-layout ='user_login'; if ( $this-Auth-user() ) { $user = $this-Auth-user(); $this-User-id = $this-Auth-user('id'); //$user['User']['last_login'] = date ( 'Y-m-d H:i:s' ); $this-User-saveField('last_login', date('Y-m-d H:i:s')); //$this-User-save('$user'); //$this-User-last_login = date(Y-m-d H:i:s); } } When i have if ( $this-Auth-user() ) { $user = $this-Auth-user(); in my code nothing happened.If i comment it then the new row will be added. Any help would be so nice! ty in advance,Paulos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
password field is empty
Hello, I have a form which has a password field.. $form-password('userpassword', array('id'='user_registration_password','label'='','class'='inputbox1', 'value'='')); The above field with name userpassword works fine.. but when I change 'userpassword' to just 'password' , the password field is empty.. When I echoed the $this-data in my user controller I get this.. preArray ( [User] = Array ( [email_address] = 1...@test.com [password] = ) ) Any help would be appreciated. Thanks, Bharani _ Hotmail® has a new way to see what's up with your friends. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
data not write in excel sheet on server
hello Creating excel sheet with dynamic data and send email with excel shett attachment. Its runing fine on localhost but on server create excel sheet and go mail whith attachment but my excelsheet is blank my data is not write in excelsheet .whet is problem . pls hep me here my code ?php $filename =excelreport.xls; $contents = testdata1 \t testdata2 \t testdata3 \t \n; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; $header.\n.$data; $files =$filename; $to = hello_moh...@yahoo.com; $from = hello_moh...@yahoo.com; $subject =Maill Attachment test; $message = My message; $headers = From: $from; $semi_rand = md5(time()); $mime_boundary = ==Multipart_Boundary_x{$semi_rand}x; $headers .= \nMIME-Version: 1.0\n . Content-Type: multipart/ mixed;\n . boundary=\{$mime_boundary}\; $message = This is a multi-part message in MIME format.\n\n . --{$mime_boundary}\n . Content-Type: text/plain; charset= \iso-8859-1\\n . Content-Transfer-Encoding: 7bit\n\n . $message . \n\n; $message .= --{$mime_boundary}\n; $file = fopen($files,rb); $data = fread($file,filesize($files)); fclose($file); $data = chunk_split(base64_encode($data)); $message .= Content-Type: {\application/octet-stream\};\n . name=\$files\\n . Content-Disposition: attachment;\n . filename=\$files\\n . Content-Transfer-Encoding: base64\n\n . $data . \n\n; $message .= --{$mime_boundary}\n; $ok = @mail($to, $subject, $message, $headers); if ($ok) { echo pmail sent to $to!/p; } else { echo pmail could not be sent!/p; } ? Thanks Regards Ranjana Srivastava --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
http://api.cakephp.org/view_source/model/#line-1820; Fails by me as stated Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/ 2009042316 Firefox/3.0.10 Oliver On May 15, 12:27 pm, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
virtual field in related model
hello. i'm having some troubles :( i have an Order model hasMany Item model. Item should have a calculated field (Item.Cost/Item.Weight) - i modified $queryData in beforeFind callback... but this callback doesn't seems to work if the model isn't the primary one. - i modified $results in afterFind callback... but cake has many ways to load data... is there any other way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: FREE CakePHP e-book by Matt Curry
Hey, thanks! Matt rocks. On May 14, 5:05 am, Nate nate.ab...@gmail.com wrote: Hey everyone, Matt Curry (of CakePHP Digest fame) has just published a *free* e-book on advanced development techniques with CakePHP. If you're already a seasoned Cake developer, this book will help you pick up many new tricks and best-practice solutions, as well as highlighting many little-known framework features. Read all about it here:http://www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-su... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: virtual field in related model
Hi Ernesto This (calculated/dynamic fields) has been brought up several times here; this is a link to the most relevant thread I can find: http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f168cd619 Should help you out hth grigri On May 15, 12:47 pm, Ernesto e.fanz...@gmail.com wrote: hello. i'm having some troubles :( i have an Order model hasMany Item model. Item should have a calculated field (Item.Cost/Item.Weight) - i modified $queryData in beforeFind callback... but this callback doesn't seems to work if the model isn't the primary one. - i modified $results in afterFind callback... but cake has many ways to load data... is there any other way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: virtual field in related model
oh thx i haven't found that post :) On 15 Mag, 14:59, grigri j...@hendersonwebdesign.com wrote: Hi Ernesto This (calculated/dynamic fields) has been brought up several times here; this is a link to the most relevant thread I can find: http://groups.google.com/group/cake-php/browse_thread/thread/f823cc7f... Should help you out hth grigri On May 15, 12:47 pm, Ernesto e.fanz...@gmail.com wrote: hello. i'm having some troubles :( i have an Order model hasMany Item model. Item should have a calculated field (Item.Cost/Item.Weight) - i modified $queryData in beforeFind callback... but this callback doesn't seems to work if the model isn't the primary one. - i modified $results in afterFind callback... but cake has many ways to load data... is there any other way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Appropriate requestAction() alternative required
Hi, the current site I'm developing has a 3 column layout. The left column has 2 top-ten lists, the middle has the main content and the right has a few ads and a 'featured' box. At the moment I'm using requestAction() and caching to get the data for the left and right hand side columns, but I know there should be a better way of doing it. Any tips? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
redirect question
I am trying to direct a user upon successful login. It was working but now its just going directly to the default case. Is there something missing? function login() { if ($this-Auth-user()) { if (!empty($this-data)) { $san = new Sanitize(); $this-data['User']['username'] = $san-paranoid($this-data['User']['username']); $group = $this-Auth-user('group_id'); switch ($group) { case 1: $this-redirect(array('controller' = 'admin/users', 'action' = 'index')); break; case 2: $this-redirect(array('controller' = managers', 'action' = 'index')); break; case 3: $slug = $this-Auth-user('slug'); $this-redirect(array('controller' = 'investors', 'action' = 'profile/' . $slug)); break; case 4: $slug = $this-Auth-user('slug'); $this-redirect(array('controller' = 'agents', 'action' = 'profile/' . $slug)); break; default: //should never get here $this-redirect(array('controller' = 'posts', 'action' = 'index')); } } } if (empty($this-data)) { // Check to see if they are logged in .. } // Perform other checks on the empty data and set up the form. ... } } } } Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: redirect question - FIXED
Sorry to bother minor oversight. $this-Auth-autoRedirect = true; was the problem changed to $this-Auth-autoRedirect = false; _ From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] Sent: May-15-09 11:54 AM To: cake-php@googlegroups.com Subject: redirect question I am trying to direct a user upon successful login. It was working but now its just going directly to the default case. Is there something missing? function login() { if ($this-Auth-user()) { if (!empty($this-data)) { $san = new Sanitize(); $this-data['User']['username'] = $san-paranoid($this-data['User']['username']); $group = $this-Auth-user('group_id'); switch ($group) { case 1: $this-redirect(array('controller' = 'admin/users', 'action' = 'index')); break; case 2: $this-redirect(array('controller' = managers', 'action' = 'index')); break; case 3: $slug = $this-Auth-user('slug'); $this-redirect(array('controller' = 'investors', 'action' = 'profile/' . $slug)); break; case 4: $slug = $this-Auth-user('slug'); $this-redirect(array('controller' = 'agents', 'action' = 'profile/' . $slug)); break; default: //should never get here $this-redirect(array('controller' = 'posts', 'action' = 'index')); } } } if (empty($this-data)) { // Check to see if they are logged in .. } // Perform other checks on the empty data and set up the form. ... } } } } Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Customizing auth flash messages
Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got Login failed. Invalid username or password. But I need to change this message. I have to make it shorter to fit in my layout. How and where can I do this? In the login method? Thanks for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with imagecreatefrompng
Hi folks, I am creating a pretty straightforward application and am using the image behaviour plugin to manage news splash images. This all works well on my development server (PHP5, sensible set up) but when I installed on the staging server (PHP4, unknown and weird set up) the image upload was causing the to just stop with no error and no error in the error.log. I set up a quick test page which simply did: $image = imagecreatefrompng( 'img/_system/view.png' ); debug( $image ); And this worked fine, displayed: resource(3) of type (gd) I then placed the same code within the __resize method of behaviour/ image.php. Failed. I then placed the same code within /index.php (dumped to error_log rather than debug). Worked. So I traced through and came up with the problem that if the code appears before the call to $controller-dispatchMethod in dispatcher.php line 227, then the image is created fine. If it appears in dispatchMethod in object.php line 113 then it fails. I am completely stumped on this, there is nothing apparent going on between the call to dispatchMethod and what happens after this. I would really appreciate any thoughts that anyone has on this. Thanks Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Check user session
supposed i want to build an application that only permit a user only login once in a time. how to check the users session to ensure that a user currently offline or already use the application from a certain host? -- --- I Don't Know Who/What I Am Yet, But I Know Who/What I Am Not! -- Marojahan M.T. Sigiro maroja...@gmail.com GTalk : marojahan Y! : ojak_s http://ojakaja.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: belongsTo conditions in model
On 15 Mag, 00:10, emmexx emmeics...@gmail.com wrote: (cut) I created a model for segment with a belongsTo variable: var $belongsTo = array( 'Car' = array( 'className' = 'Parameter', 'foreignKey' = 'par1_id', 'conditions' = array('Car.type_id' = 55) (cut) I don't understand if I'm missing something or doing something wrong or I'm asking too much to cakephp. I checked the code in cake/libs/model/model.php and the find function, as I understand, doesn't care about $this-belongsTo. Therefore I don't understand where and when the model association gets used. The manual in the chapter about Association (http://book.cakephp.org/ view/78/Associations-Linking-Models-Together) says: Once this association has been defined, find operations on the User model will also fetch a related Profile record if it exists: (...) maxx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Not fully understanding associations. Id showing instead of name.
Hi all, Apologies for this newbish question, I've searched for hours trying to resolve this with no joy so would appreciate it if you could point me in the right direction. I'm trying to setup a simple website (my first cakephp project, having become OKish at PHP/MYSQL). Basically there are three models so far, posts, categories and sites (all of the databases follow cake naming conventions, with id as PK, name and _id for FKs. Posts belong to categories. Posts also belong to sites. Categories, and sites have one post. I have used cake bake to generate the controllers and views. /posts/ works great, and it shows everything by name, the add works great in terms of the relationships. The problem I am having is, when I go to /categories/, it brings up posts under that category and the category and site are showing up as numbers rather than name (in the view they are category_id, and site_id). I can get the category name to show up OK (because I think that table is mapped). What I don't understand is why the name is not showing in place of the _id like everwhere else. How can I output database fields in another model. It is probably something really simple, but I'm getting used to the cake way of thinking. Is it that the relationship is wrong? The query at the bottom shows the names are being selected. Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Customizing auth flash messages
Set $this-Auth-loginError in AppController::beforeFilter(). On Fri, May 15, 2009 at 10:57 AM, Roman Brunnemann mailingli...@gmx.de wrote: Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got Login failed. Invalid username or password. But I need to change this message. I have to make it shorter to fit in my layout. How and where can I do this? In the login method? Thanks for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to run schema file without using cake console?
Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How manage triple relation between Model in CAKEPHP?
Hi I have three model that have a triple relation between them. How can I manage this triple relation between Model in CAKEPHP? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Not fully understanding associations. Id showing instead of name.
set $displayField in the model.. http://book.cakephp.org/view/438/displayField -- pietro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Not fully understanding associations. Id showing instead of name.
OK, so I tried setting recursive to two again (didn't work earlier) and it worked! Is there a better method to do this for future reference as it seems to place a bit of a load of the database... On May 15, 4:12 pm, number9 xpozit...@gmail.com wrote: Hi all, Apologies for this newbish question, I've searched for hours trying to resolve this with no joy so would appreciate it if you could point me in the right direction. I'm trying to setup a simple website (my first cakephp project, having become OKish at PHP/MYSQL). Basically there are three models so far, posts, categories and sites (all of the databases follow cake naming conventions, with id as PK, name and _id for FKs. Posts belong to categories. Posts also belong to sites. Categories, and sites have one post. I have used cake bake to generate the controllers and views. /posts/ works great, and it shows everything by name, the add works great in terms of the relationships. The problem I am having is, when I go to /categories/, it brings up posts under that category and the category and site are showing up as numbers rather than name (in the view they are category_id, and site_id). I can get the category name to show up OK (because I think that table is mapped). What I don't understand is why the name is not showing in place of the _id like everwhere else. How can I output database fields in another model. It is probably something really simple, but I'm getting used to the cake way of thinking. Is it that the relationship is wrong? The query at the bottom shows the names are being selected. Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Threaded count
Yes is related to cake, well all I want to know is if there is a solution to this in cake. I have Categories like Array( [0] = Array( [Category] = Array( [id] = 1, [parent_id] = null, [name] = 'Parent category 1', [product_count] = 0 ), [children] = Array( [0] = Array( [Category] = Array( [id] = 2, [parent_id] = 1, [name] = 'Subcategory 1', [product_count] = 5 ) ) ) ) ) Thing is: i can only have products in a subcategory, I want to know if it's a possibility in cake to obtain in the parent category the number of products associated to it's subcategories. What i have is On Fri, 2009-05-15 at 01:58 -0700, majna wrote: Try with find('all') with joins , group by, count.. to attach product counts. see Model::_findThreaded()if it can helps to SUM counts. Do you think this problem is related to cakephp? On May 15, 8:49 am, Bogdan I. Bursuc bogdanbursu...@gmail.com wrote: I know that, product_count is the counter_cache, but only for the subcategories the ones that have a parent_id from the categories, is a threaded model, and when i select the main categories i want to know the count of the products in all the subcategories :). That's my dilemma. Thx. On Thu, 2009-05-14 at 13:47 -0700, majna wrote: there is counter cache counter_cache property. check manual. On May 14, 4:41 pm, Bogdan I. Bursuc bogdanbursu...@gmail.com wrote: I have the following model: categories: - id, - parent_id, - name, - product_count So, the model is threaded: exists main categories and subcategories that's it, but only subcategories contain products so only for subcategories product_count will be incremented. My question: Is there a way in cake so that when i do a find on the main categories to obtain the number of products in all it's subcategories. Thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Not fully understanding associations. Id showing instead of name.
Actually I tried displayfield earlier when I was searching, but it didn't work, presumably because: The model will use name or title, by default. and I am trying to output name (so it should be doing that anyway). On May 15, 4:33 pm, number9 xpozit...@gmail.com wrote: OK, so I tried setting recursive to two again (didn't work earlier) and it worked! Is there a better method to do this for future reference as it seems to place a bit of a load of the database... On May 15, 4:12 pm, number9 xpozit...@gmail.com wrote: Hi all, Apologies for this newbish question, I've searched for hours trying to resolve this with no joy so would appreciate it if you could point me in the right direction. I'm trying to setup a simple website (my first cakephp project, having become OKish at PHP/MYSQL). Basically there are three models so far, posts, categories and sites (all of the databases follow cake naming conventions, with id as PK, name and _id for FKs. Posts belong to categories. Posts also belong to sites. Categories, and sites have one post. I have used cake bake to generate the controllers and views. /posts/ works great, and it shows everything by name, the add works great in terms of the relationships. The problem I am having is, when I go to /categories/, it brings up posts under that category and the category and site are showing up as numbers rather than name (in the view they are category_id, and site_id). I can get the category name to show up OK (because I think that table is mapped). What I don't understand is why the name is not showing in place of the _id like everwhere else. How can I output database fields in another model. It is probably something really simple, but I'm getting used to the cake way of thinking. Is it that the relationship is wrong? The query at the bottom shows the names are being selected. Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
changing the default index view (from pages/index.ctp to, say, /news/index.ctp)
Hello! I'm making a website where the first home page should be the news page. I would like to change the default /pages/index.ctp to another one, like /news/index.ctp or /news/viewNews.ctp, etc. How can I do that? Thanks!!! -- View this message in context: http://www.nabble.com/changing-the-default-index-view-%28from-pages-index.ctp-to%2C-say%2C--news-index.ctp%29-tp23562479p23562479.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I have three model that have a triple relation between them. How can I manage this triple relation between Model in CAKEPHP? via belongsTo, hasMany and a model for each table - the usual way. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Is there any way that we can handle the model save or update error in a general way?
For example, we usually write these code in our app$result = $this-model-save(); if($result){ $this-log-(//); } -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Is there any way that we can handle the model save or update error in a general way?
For example,Usually, we write [code] $result = $this-Model-save(); if(!$result){ //... } [/code] This way ,we will write the model error handle code everywhere we use model save or update function. I mean is there a way that we can write a function in app_controller or other places than can help us to reduce these redundant code? -- Thanks Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing the default index view (from pages/index.ctp to, say, /news/index.ctp)
How can I do that? modifying config/routes.php where there is a line like: Router::connect('/', array('controller' = 'Name of your controller', 'action' = 'Name of your action')); more info: http://book.cakephp.org/view/341/Routes -- pietro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing the default index view (from pages/index.ctp to, say, /news/index.ctp)
In the appconfigroutes.php. You will find the default /pages/ setting, you can change it to what controller and action you want. On May 15, 6:46 pm, mig_akira mig_ak...@hotmail.com wrote: Hello! I'm making a website where the first home page should be the news page. I would like to change the default /pages/index.ctp to another one, like /news/index.ctp or /news/viewNews.ctp, etc. How can I do that? Thanks!!! -- View this message in context:http://www.nabble.com/changing-the-default-index-view-%28from-pages-i... Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with imagecreatefrompng
I would really appreciate any thoughts that anyone has on this. can you put the code of the behavior in a pastebin ? i use imagecreatefrom* in a behavior without any problem.. -- pietro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How manage triple relation between Model in CAKEPHP?
And, if you have three habtm relations between model 1 and model2? On May 15, 5:56 pm, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I have three model that have a triple relation between them. How can I manage this triple relation between Model in CAKEPHP? via belongsTo, hasMany and a model for each table - the usual way. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Routes regarding - e-book by Matt Curry
Hey Dave, Great question. Something I will definitely add to the next version. Try: Router::connect('/:prefix/:controller/add', array('action' = 'edit')); -Matt http://www.pseudocoder.com On May 14, 6:57 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: In the section regarding the add / edit functions in 1 he has the routes Router::connect('/:controller/add', array('action' = 'edit')); How would you configure this for the admin routing? I tried Router::connect('/:controller/add', array('action' = 'edit')); or Router::connect('/:controller/add', array('action' = 'edit', 'admin' = true)); Or Router::connect('/admin/:controller/add', array('action' = 'edit')); And nothing...if I attempted to go to add in the url page not found...did not connect me to edit. Ideas? -Original Message- From: Nate [mailto:nate.ab...@gmail.com] Sent: May-14-09 5:36 AM To: CakePHP Subject: FREE CakePHP e-book by Matt Curry Hey everyone, Matt Curry (of CakePHP Digest fame) has just published a *free* e-book on advanced development techniques with CakePHP. If you're already a seasoned Cake developer, this book will help you pick up many new tricks and best-practice solutions, as well as highlighting many little-known framework features. Read all about it here:http://www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-su... some-advanced-cakephp-tips/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Routes regarding - e-book by Matt Curry
Sweet deal! Thanks man! Great job on the book lots of great tips and tricks indeed. Thanks for sharing your insight. Dave -Original Message- From: Matt Curry [mailto:m...@mcurry.net] Sent: May-15-09 1:57 PM To: CakePHP Subject: Re: Routes regarding - e-book by Matt Curry Hey Dave, Great question. Something I will definitely add to the next version. Try: Router::connect('/:prefix/:controller/add', array('action' = 'edit')); -Matt http://www.pseudocoder.com On May 14, 6:57 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: In the section regarding the add / edit functions in 1 he has the routes Router::connect('/:controller/add', array('action' = 'edit')); How would you configure this for the admin routing? I tried Router::connect('/:controller/add', array('action' = 'edit')); or Router::connect('/:controller/add', array('action' = 'edit', 'admin' = true)); Or Router::connect('/admin/:controller/add', array('action' = 'edit')); And nothing...if I attempted to go to add in the url page not found...did not connect me to edit. Ideas? -Original Message- From: Nate [mailto:nate.ab...@gmail.com] Sent: May-14-09 5:36 AM To: CakePHP Subject: FREE CakePHP e-book by Matt Curry Hey everyone, Matt Curry (of CakePHP Digest fame) has just published a *free* e-book on advanced development techniques with CakePHP. If you're already a seasoned Cake developer, this book will help you pick up many new tricks and best-practice solutions, as well as highlighting many little-known framework features. Read all about it here:http://www.pseudocoder.com/archives/2009/05/13/free-cakephp-e-book-su.. . some-advanced-cakephp-tips/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Application setup where each customer has own database
Thanks a lot for the answer! That kind of database selection is indeed perfect for me and much simpler.. don't have to do any custom db drivers. Thanks again! I have couple questions though, as this is the first time I'm using CakePHP and don't know much about it yet. 1. Can I link tables between database configs? Yes, but Cake will always run separate queries, no any joins. How do you define a link between Models that are not in the same database? I know that with useDbConfig I can tell CakePHP that which database to use for the model, but when I'm creating a link from users to employees table for example, how can I tell CakePHP that the employees table is in the other database? Or do I need to tell that even? Will Cake check the useDbConfig from the employee model automatically? E.g. would this simply work: class User extends AppModel { var $useDbConfig = 'commondb'; var $name = 'User'; var $hasOne = 'Employee'; } class Employee extends AppModel { var $useDbConfig = 'companydb'; var $name = 'Employee'; } // get employee object from the user object $employee = $user-Employee; Then to another question... You can determine and save database name by something like this (I assume that routing with param 'company' is used): I tried to read about the routing in CakePHP, but I didn't quite get it.. so how can I make it work with urls like: www.domain.com/company1/controller/action www.domain.com/company2/controller/action and take that first part of the url out to save as db name (with Configure::write like you pointed out) and then use the rest of the url to navigate normally to the controller / action. I could do it in the app/webroot/index.php before the $url parameter is passed to the dispatcher, but I'm guessing that would be the wrong way to do it. Can I do it with the routing somehow? These might be quite trivial things for more advanced CakePHP users, but for me as a newbie, I haven't quite grasped the idea yet.. I'm definitely going to do some write up of the whole setup. On May 15, 5:44 am, Dr. Loboto drlob...@gmail.com wrote: 1. Can I link tables between database configs? Yes, but Cake will always run separate queries, no any joins. 2. How to automate the database table selection? Method on link you provided looks too complex for your situation. If each company have own databases with completely same structure, the only thing you need to do for company specific models is to select appropriate DB config. You can determine and save database name by something like this (I assume that routing with param 'company' is used): class AppController extends Controller { function constructClasses() { // Save company name when we already know it but before models are created Configure::write( 'companyDB', !empty($this-params['company']) ? $this-params['company'] : false ); parent::constructClasses(); } } Mark all company-specific models like this: class CompanyProfile extends AppModel { var $specific = true; } And have such AppModel: class AppModel extends Model { var $specific = false; function __construct($id = false, $table = null, $ds = null) { if ($this-specific) { // Get saved company/database name $dbName = Configure::read('companyDB'); // Get common company-specific config (should be present in database.php) $config = ConnectionManager::getDataSource('defaultSpecific')-config; // Set correct database name $config['database'] = $dbName; // Add new config to registry ConnectionManager::create($dbName, $config); // Point model to new config $this-useDbConfig = $dbName; } parent::__construct($id, $table, $ds); } } ... So I'd like to use the first part of the url instead. Read about routing:http://book.cakephp.org/view/46/Routes-Configuration On May 15, 2:13 am, doze doze...@gmail.com wrote: Hello, I would like to get an advice on how to build an application with CakePHP where there are multiple customers (companies) using the application and each have their own database, but also some common tables in another database. Let me explain the database structure: Tables in common database: - Users - Companies - Common settings - ... Tables in company specific database: - Users extra profile data - Company employees - ... So all users register to the application and the basic information is stored in a table in the common database. The application lists companies that are available. When users goes to
Re: How manage triple relation between Model in CAKEPHP?
I haven't understand . Can you make me and example? Many Thanks On 15 Mag, 17:56, AD7six andydawso...@gmail.com wrote: On May 15, 5:32 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I have three model that have a triple relation between them. How can I manage this triple relation between Model in CAKEPHP? via belongsTo, hasMany and a model for each table - the usual way. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Customizing auth flash messages
Perfect!!! Many thanks. This is what I was looking for. Best regards, Roman brian wrote: Set $this-Auth-loginError in AppController::beforeFilter(). On Fri, May 15, 2009 at 10:57 AM, Roman Brunnemann mailingli...@gmx.de wrote: Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got Login failed. Invalid username or password. But I need to change this message. I have to make it shorter to fit in my layout. How and where can I do this? In the login method? Thanks for your help. Best regards, Roman --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
It does not fail for me. Mozilla/5.0 (Windows; U; Windows NT 5.1; en- US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) As suggested, perhaps it's caused by a rogue extension? On May 15, 7:29 am, oliver.pra...@googlemail.com oliver.pra...@googlemail.com wrote: http://api.cakephp.org/view_source/model/#line-1820; Fails by me as stated Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/ 2009042316 Firefox/3.0.10 Oliver On May 15, 12:27 pm, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
On Thu, May 14, 2009 at 11:49 PM, Mr-Yellow meisteryel...@gmail.com wrote: Yeah guys dropping IE is the best bet. Seeing FF doesn't work either. What I should really do is stop testing in the browser that the VAST majority of my surfers use. Take your browser fanboy crap elsewhere, I just want the documentation fixed so it can be viewed in a browser, any one will do. What are you, 12 years old? And I said nothing about dropping IE. Pardon me for the casual aside as I backed up your complaint. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to extend ajax helper?
Great thanks! On May 14, 10:02 pm, Kyo ready2jam2n...@gmail.com wrote: Use require_once() before the class statement and it'll do the trick. require_once LIBS . 'view'. DS . 'helpers' . DS . 'ajax.php'; class MyAjaxHelper extends AjaxHelper { } hth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
I had the same problem with FF cutting off the model page at line 1820. Disabling Firebug for the API pages fixed it for me. -Matt http://www.pseudocoder.com On May 15, 6:27 am, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
I'm offended that you think that's how I would respond to the tickets. Firstly you put them in the wrong place, secondly, they've been fixed. So there. -Mark On May 14, 11:58 pm, Mr-Yellow meisteryel...@gmail.com wrote: Anyone want to place bets on how long it is before the tickets are deleted and ignored? -Ben On May 15, 1:57 pm, Mr-Yellow meisteryel...@gmail.com wrote: New Tickets: API Documentation fails in IEhttps://trac.cakephp.org/ticket/6376 API Documentation fails in FFhttps://trac.cakephp.org/ticket/6377 -Ben On May 15, 1:49 pm, Mr-Yellow meisteryel...@gmail.com wrote: Yeah guys dropping IE is the best bet. Seeing FF doesn't work either. What I should really do is stop testing in the browser that the VAST majority of my surfers use. Take your browser fanboy crap elsewhere, I just want the documentation fixed so it can be viewed in a browser, any one will do. -Ben- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
The issue with Firefox is bound to Windows only. Its an issue with how windows actually functions. Because the UI elements are 16bit they cannot exceed the pixel dimensions of the 16bit space. So mozilla is bound by shoddy windows widgets, and the Api was bound by that implementation. I'm going to be redesigning the source code output to fix this issue. Seeing as there is a better chance of glaciers to destroying my house before Microsoft fixes 16 bit api's. -Mark On May 15, 2:03 pm, Matt Curry m...@mcurry.net wrote: I had the same problem with FF cutting off the model page at line 1820. Disabling Firebug for the API pages fixed it for me. -Matthttp://www.pseudocoder.com On May 15, 6:27 am, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
Say what? LOL. Sorry Mark, I truly am interested to understand what the issue was, I just don't think I really understood your explanation. Would you be willing to explain it further? A nope will suffice too, of course. :) On May 15, 2:21 pm, mark_story mark.st...@gmail.com wrote: The issue with Firefox is bound to Windows only. Its an issue with how windows actually functions. Because the UI elements are 16bit they cannot exceed the pixel dimensions of the 16bit space. So mozilla is bound by shoddy windows widgets, and the Api was bound by that implementation. I'm going to be redesigning the source code output to fix this issue. Seeing as there is a better chance of glaciers to destroying my house before Microsoft fixes 16 bit api's. -Mark On May 15, 2:03 pm, Matt Curry m...@mcurry.net wrote: I had the same problem with FF cutting off the model page at line 1820. Disabling Firebug for the API pages fixed it for me. -Matthttp://www.pseudocoder.com On May 15, 6:27 am, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: api.cakephp.org still broken
I'm seeing it in FF3.0.10/linux (I guess that's what I get for being a linux fan-boy) On Fri, May 15, 2009 at 2:21 PM, mark_story mark.st...@gmail.com wrote: The issue with Firefox is bound to Windows only. Its an issue with how windows actually functions. Because the UI elements are 16bit they cannot exceed the pixel dimensions of the 16bit space. So mozilla is bound by shoddy windows widgets, and the Api was bound by that implementation. I'm going to be redesigning the source code output to fix this issue. Seeing as there is a better chance of glaciers to destroying my house before Microsoft fixes 16 bit api's. -Mark On May 15, 2:03 pm, Matt Curry m...@mcurry.net wrote: I had the same problem with FF cutting off the model page at line 1820. Disabling Firebug for the API pages fixed it for me. -Matthttp://www.pseudocoder.com On May 15, 6:27 am, John Andersen j.andersen...@gmail.com wrote: Hi Burzum Can you open the following location in FF 3.0.10 (which I have), as I do have the problem that the code disappears after that line! http://api.cakephp.org/view_source/model/#line-1820; Then return and tell me what you got! John On May 15, 12:18 pm, burzum bur...@doomzone.de wrote: I agree with AD7six, the tickets are bad, you don't even mention the exact version number of the browsers. That's how i expect end users to report a bug, not a developer. ;) I never had any problems with the API documentation and i regularly update FF, my current version is 3.0.10, it works also in Opera 9.64 and every version i used before. Also the IE8 shipped with the Win7 RC does its job. I guess that you can't see the source view is caused by a bad extension that filters or manipulates something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Migration to UUIDs from AUTO_INCREMENT
I am trying to migrate data from a schema that used auto_increment integers in a MySQL database to a newly built CakePHP framework application which will use UUIDs for the primary keys. I am having issues updating the previous records and replacing the old ids ('1', '2', '3', etc.) with generated UUIDs. As I am relatively new to CakePHP (but not PHP itself), I may just have things out of order. All current attempts to update the primary key result in insertion of a new blank record with a UUID as the primary key. Can anyone provide guidance and/or snippets to iterate through the records and replace the old id in the primary key with a UUID? NOTE: The id field is already set to CHAR(36) and listed as PRIMARY KEY --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Multi language and invalid Config.language
I have a multi language site where people can change language using the P28nController and P28nComponent. I bootstrap.php I set a default language. The problem right now is that somehow I got an invalid Config.language setting. If I in my code do: --- print_r($this-Session-read(Config.language)); --- I get: -- Array ( [2؛] = �G5G��Kn��: ) - which seems invalid. The problem here is that it produces an invalid page since cake cant find the locale. What should I do to get round these errors. Other can have invalid languages as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Installing CakePHP to mediatemple(dv) issue
I have a problem installing CakePHP(v. 1.2.3.8166) to MT(dv) I created cake directory and uploaded all files there and if I tried to access mydomain.com/cake then browser tries to download download file. What is the problem and how I can fix it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Migration to UUIDs from AUTO_INCREMENT
I'm sorry that i can't help you with an issue, but if you have got a moment could you , please clarify the advantage of using UUID instead of ID? Thank you in advance. On 15 май, 22:42, tcornett tcorn...@gmail.com wrote: I am trying to migrate data from a schema that used auto_increment integers in a MySQL database to a newly built CakePHP framework application which will use UUIDs for the primary keys. I am having issues updating the previous records and replacing the old ids ('1', '2', '3', etc.) with generated UUIDs. As I am relatively new to CakePHP (but not PHP itself), I may just have things out of order. All current attempts to update the primary key result in insertion of a new blank record with a UUID as the primary key. Can anyone provide guidance and/or snippets to iterate through the records and replace the old id in the primary key with a UUID? NOTE: The id field is already set to CHAR(36) and listed as PRIMARY KEY --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appropriate requestAction() alternative required
*bump* --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth - How to show a message logged in as John' when the user is already logged in
Indeed it helped! Thanks! Kyo-4 wrote: This might help: http://groups.google.ch/group/cake-php/browse_thread/thread/ee9456de93d2eece/7c930c0b46b7eafc?lnk=gstq=isAuthed#7c930c0b46b7eafc -- View this message in context: http://www.nabble.com/Auth--%3E-How-to-show-a-message-%22logged-in-as-John%27-when-the-user-is-already-logged-in-tp23553382p23568606.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing the default index view (from pages/index.ctp to, say, /news/index.ctp)
Great guys! Thanks a lot! Claudiu Apetrei wrote: In the appconfigroutes.php. You will find the default /pages/ setting, you can change it to what controller and action you want. On May 15, 6:46 pm, mig_akira mig_ak...@hotmail.com wrote: Hello! I'm making a website where the first home page should be the news page. I would like to change the default /pages/index.ctp to another one, like /news/index.ctp or /news/viewNews.ctp, etc. How can I do that? Thanks!!! -- View this message in context:http://www.nabble.com/changing-the-default-index-view-%28from-pages-i... Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/changing-the-default-index-view-%28from-pages-index.ctp-to%2C-say%2C--news-index.ctp%29-tp23562479p23568611.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problems with belongTo and hasMany
Hi, I'm new to cakephp and I'm confused about the model setup... I have class kids belongsTo parents and class school hasMany kids. Now in my index for kids I can retrieve all parent information based on the foreign key. However in school, i have access to the kid information but not the parents info that belongs to the kids. Does this belongsTo info not pass along parent info to the school class? If so, I have trouble setting it up... Please let me know if you need the actual code snippet and I will gladly paste. -- View this message in context: http://www.nabble.com/Problems-with-belongTo-and-hasMany-tp23567941p23567941.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems with belongTo and hasMany
Hello hahmadi82, Maybe using a code like this: $schools = $this-find(all, array(recursive = 2)); The option recursive take more info in the models. On May 15, 8:19 pm, hahmadi82 hahmad...@gmail.com wrote: Hi, I'm new to cakephp and I'm confused about the model setup... I have class kids belongsTo parents and class school hasMany kids. Now in my index for kids I can retrieve all parent information based on the foreign key. However in school, i have access to the kid information but not the parents info that belongs to the kids. Does this belongsTo info not pass along parent info to the school class? If so, I have trouble setting it up... Please let me know if you need the actual code snippet and I will gladly paste. -- View this message in context:http://www.nabble.com/Problems-with-belongTo-and-hasMany-tp23567941p2... Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems with belongTo and hasMany
bump -- View this message in context: http://www.nabble.com/Problems-with-belongTo-and-hasMany-tp23567941p23568933.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Configure::write('Session.start', true); does *NOT* turn sessions on but session_start() does.
Help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Poll: what do you hate about CakePHP?
Thought of another one. Paginate settings, and paginate call. Why do they have the same name? When learning how Cake works, although it's proper OOP to do so, it's a bit confusing to see: $this-paginate = array('contain' = 'User'); $this-set('posts', $this-paginate()); I think it would be clearer (from a name the variable what it is type of coding style) to use something like: $this-paginateOptions = array('contain' = 'User'); Every time I see $this-paginate when skimming through code, I immediately see the method, completely forgetting it's also a property. I hate that. ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appropriate requestAction() alternative required
look at elements On Fri, May 15, 2009 at 2:50 PM, seanislegend boredofm...@googlemail.com wrote: *bump* --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---