Trailing Slash redirect (SEO) and CakePHP Forms
Hi there! I have a Problem with my App. In my .htaccess, i added some lines to redirect the user if the url ends without a slash to the same page with a slash. For example: redirect /posts/view/2 to /posts/view/2/ Now, I have a form /posts/add/. I use the Cakehelper to create it, and it makes a http://groups.google.com/group/cake-php/browse_thread/thread/b98f3ccd0727dba4/721d4f9cf1120e2e?lnk=gst&q=canonicalization#721d4f9cf1120e2e Hope anyone can help me with this.. Thanks! Andi Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Containable + HABTM + conditions PROBLEM [urgent]
Well, I think the quick tip from nate about ad.hoc joins ( http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find ) is exactly what I need. I tried it like this: $checklist = $this->Checklist->Product->Module->find('matches', array ( 'model' => 'Version', 'scope' => array('Version.name' => 'short') )); this gives me: SQL Error: 1054: Unknown column 'Module.Version' in 'field list' [CORE \cake\libs\model\datasources\dbo_source.php, line 525] with this sql: Query: SELECT `Module`.`Version`, `Module`.`Array`, `Module`.`id` FROM `modules` AS `Module` WHERE matchesLIMIT 1 why he does an sql like this?! i just copied the code from nates post to my appcontroller... perhaps its easier in normal sql, but as im not an sql professional i wanted to do it the cakeish way.. Thanks for any help... On 6 Jul., 09:31, "Andreas D." wrote: > Thanks, but it doesn't work. > Gives me this query: > SELECT `Module`.`id`, `Module`.`position`, `Module`.`name`, > `Module`.`created`, `Module`.`modified` FROM `modules` AS `Module` > WHERE `Version`.`name` = 'covermount' > > and this error: > 1054: Unknown column 'Version.name' in 'where clause' > > On 3 Jul., 20:14, brian wrote: > > > Something like this? > > > $modules = $this->Product->Module->find( > > 'all', > > array( > > 'conditions' => array( > > 'Version.name' => $version > > ), > > 'contain' => array( > > 'Version' => array( > > 'fields' => array('*') > > ) > > ) > > ) > > ); > > > On Fri, Jul 3, 2009 at 6:00 AM, Andreas Derksen > > wrote: > > > Hi all, > > > i got some problems with my habtm containable setup. This is it: > > > > Product HABTM Module > > > Module HABTM Version > > > > in the Product controller i want to find all modules that belong to an > > > certain version defined in the Version model. > > > > this was my approach: > > > $this->Product->id = $id; > > > $this->Product->find('first', array('contain' => array('Module' => > > > array('conditions' => array('Version.name' => $version); > > > > but it says: > > > > Unknown column 'Version.name' in 'where clause' > > > > how do i query it with or without the Containable behavior? --~--~-~--~~~---~--~~ 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: Containable + HABTM + conditions PROBLEM [urgent]
Thanks, but it doesn't work. Gives me this query: SELECT `Module`.`id`, `Module`.`position`, `Module`.`name`, `Module`.`created`, `Module`.`modified` FROM `modules` AS `Module` WHERE `Version`.`name` = 'covermount' and this error: 1054: Unknown column 'Version.name' in 'where clause' On 3 Jul., 20:14, brian wrote: > Something like this? > > $modules = $this->Product->Module->find( > 'all', > array( > 'conditions' => array( > 'Version.name' => $version > ), > 'contain' => array( > 'Version' => array( > 'fields' => array('*') > ) > ) > ) > ); > > On Fri, Jul 3, 2009 at 6:00 AM, Andreas Derksen > wrote: > > Hi all, > > i got some problems with my habtm containable setup. This is it: > > > Product HABTM Module > > Module HABTM Version > > > in the Product controller i want to find all modules that belong to an > > certain version defined in the Version model. > > > this was my approach: > > $this->Product->id = $id; > > $this->Product->find('first', array('contain' => array('Module' => > > array('conditions' => array('Version.name' => $version); > > > but it says: > > > Unknown column 'Version.name' in 'where clause' > > > how do i query it with or without the Containable behavior? --~--~-~--~~~---~--~~ 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: Input fields prefilled / prechecked depending on database field
Oops, accidentally replied to an other discussion :| --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
hasMany problem
Hello all together, i'm currently developing a checklist application. I got problems linking the models together right now.. I got one Checklist model which belongsTo a User, Language, OperatingSystem, Product. My User hasMany Checklist. Now I want to fetch all User related checklists through the UsersController. So when I do a $this->User->find('first', array ('conditions' => array('id' => $id))); I get only the checklists language_id's, operating_system_id's ... how do i get the Language.name fields? here is the full output: Array ( [User] => Array ( [id] => 1 [name] => Testname [email] => testn...@test.de [created] => 2009-05-15 12:44:30 [modified] => ) [Checklist] => Array ( [0] => Array ( [id] => 1 [user_id] => 1 [language_id] => 2 [operating_system_id] => 1 [product_id] => 1 [component_string] => [created] => 2009-05-15 14:07:16 [modified] => ) [1] => Array ( [id] => 2 [user_id] => 1 [language_id] => 3 [operating_system_id] => 3 [product_id] => 4 [component_string] => [created] => 2009-05-15 14:56:33 [modified] => ) ) ) So long, Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---