Re: Newbie - multiple model instances in one form and validation

2008-12-24 Thread Nature Lover
Hi! Thanks for the help! Got it resolved. Actually the fault was mine. I was validating the foreign key user_id in both child models UserProfile and UserContact. Thats why the saveAll($this->data, array('validate' => 'only')) or saveAll($this->data, array('validate' => 'first')) was failing.

RE: Updating multiple models

2008-12-24 Thread Steven Wright
Ahh I figured out thanks to teknoid. I had forgotten to put the ID of the recipe in a hidden field in the edit form. Check out this excellent post from teknoid. http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-work ing-with-multiple-models/#comment-909 -Original Mes

Re: paginate using named parameters

2008-12-24 Thread Jay Reeder
You can also include this in the view before using the paginator helper functions: $paginator->options(array('url' => $this->passedArgs)); The above line will tell paginator to create URL's that have the same named parameters as the page you're currently on. On Tue, Dec 23, 2008 at 8:59 PM, kai

Updating multiple models

2008-12-24 Thread rhythmicde...@gmail.com
This post should be called so close yet so far. I am having an issue with saveAll() in my edit method which I am hoping you can help me with. For some reason that I cant determine it's creating new records in both tables instead up updating them. I am sure it's something goofy that I have missed.

[RC4] parseExtension and 404 throwing

2008-12-24 Thread Jne
Hi, on my website I have a 'movie_comments' controller and a feed($id) action. With RC3 : http://sph3re.tv/movie_comments/feed/151.rss is outputting the proper RSS feed http://sph3re.tv/movies/mainfeed.rss also With RC4 (caching disabled) http://sph3re.tv/movie_comments/feed/151.rss is throwing

installation of cakephp

2008-12-24 Thread mona
when we install cakephp then in httpd.conf of apache where we find Addmodule mod_rewrite.c. this is for unix os because i m using windows --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to thi

RE: Saving Multiple Models in one save

2008-12-24 Thread Steven Wright
Thank you thank you. That was exactly what I was looking for. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Adriano Varoli Piazza Sent: Wednesday, December 24, 2008 8:05 AM To: CakePHP Subject: Re: Saving Multiple Models in one save

cms in cake php

2008-12-24 Thread mona
I have to make cms using cakephp and in that cms i have to increment a count every time when new content add in cms for that first i have to make login script can anybody tell me how to make login script in php and i want that when i type address it should open my login page not index page and als

RE: Saving Multiple Models in one save

2008-12-24 Thread Steven Wright
Thank you very much. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Adriano Varoli Piazza Sent: Wednesday, December 24, 2008 8:05 AM To: CakePHP Subject: Re: Saving Multiple Models in one save On 24 dic, 10:32, Steven Wright wrote:

Re: Find Topic with highest number of Comments

2008-12-24 Thread dr. Hannibal Lecter
I have used this bit of code in my model..It's probably not the best way, but it works for me: function getMostCommented($limit) { $commentsCount = $this->Comment->find ( 'all',

Weird Error With ACL

2008-12-24 Thread Christian
Hi, I'm trying to use ACL in my application, I have pretty much followed this tutorial http://book.cakephp.org/view/641/Simple-Acl-controlled-Application to get my application up and running, however, when I visit any of the pages that are supposed to be protected, I get this error: Warning (512

Re: Thoughts on this blog post?

2008-12-24 Thread villas
Looks like he's changing his mind... http://ajbrown.org/blog/2008/12/23/maybe-i-was-too-hard-on-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@

Find Topic with highest number of Comments

2008-12-24 Thread Fahad
hi, i am developing a forum application in cakephp. and need to find a list of 5 popular topics (threads). popularity is based on the number of Comment each Topic has. is it possible to find popular Topics using cake models only? or do I have to use custom SQL query for this? thanks --~--~-

Re: Getting related data

2008-12-24 Thread dr. Hannibal Lecter
You should probably change this: $this->set('ingredient_list', $this->IngredientList->find('WHERE recipe_id = ' . $id)); to something like this: $this->set('ingredient_list', $this->IngredientList->find('all', array ('recipe_id' => $id)); And then see what happens. Also, I don't see where are

Re: Saving Multiple Models in one save

2008-12-24 Thread Adriano Varoli Piazza
On 24 dic, 10:32, Steven Wright wrote: > What does the 0 do? Make it work :) Seriously, you can add multiple items in this fashion, such as Patrimonio.1.tipo, Patrimonio.2.tipo, etc., and they'll be saved in sequence from a single form. However, I doubt that this is the problem, I suspect more

Re: Thoughts on this blog post?

2008-12-24 Thread keymaster
http://ajbrown.org/blog/2008/12/23/maybe-i-was-too-hard-on-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

RE: Saving Multiple Models in one save

2008-12-24 Thread Steven Wright
What does the 0 do? -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Adriano Varoli Piazza Sent: Wednesday, December 24, 2008 7:26 AM To: CakePHP Subject: Re: Saving Multiple Models in one save In a similar situation, my add view loo

Getting related data

2008-12-24 Thread rhythmicde...@gmail.com
I have recipes and I have ingredient_lists. A single recipe has many entries in the ingredient_lists table. When I pull back the recipe I want to get it's ingredient_list but I cant see quite how to do it. This is the 'edit' action of the RecipesController: function edit($id = null)

Re: Saving Multiple Models in one save

2008-12-24 Thread Adriano Varoli Piazza
In a similar situation, my add view looks like this: echo $form->label('Patrimonio.0.tipo', 'Label text:'); echo $form->text('Patrimonio.0.tipo'); Notice the 0. -- Saludos, Adriano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: custom SQL query - all values IN() bust be AND

2008-12-24 Thread Smelly_Eddie
dev if thats the case than my last post should asswer your questions. On Dec 24, 3:35 am, dev wrote: > I will give an example: > > Advert hasMany Option > I need to find Adverts, where its Options are 3 and 4 values. When > using IN, it will return results with 3, or, 4, or both 3 and 4. But i >

Re: Finding content from multiple tables being referred

2008-12-24 Thread Nature Lover
Hi! Thanks for the help! I got it resolved using If in MySQL query as condition $condition = 'IF(((select count(*) from '.$Table.' where language_code="'.$this->Session->read('Site.Language').'" and '. $ReferKey.'='.$Model.'.'.$ReferKey.')>0), language_code="'.$this- >Session->read('Site.Langua

Re: Newbie - multiple model instances in one form and validation

2008-12-24 Thread Nature Lover
Hi! I haven't used the form helper instead created form using bare html to decrease the server load. The form used can be referred over here http://prowebdesignsolutions.com/refer/ Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Newbie - multiple model instances in one form and validation

2008-12-24 Thread sijo jose
Hi , If the model associations are correct and the for is created using User just user $this->User->saveAll($this->data,array('validation'=>'first')) will validate all the Models, well as I said the model associations must be perfect. Regards Sijo Jose C On Wed, Dec 24, 2008 at 4:25 PM, Nature

Newbie - multiple model instances in one form and validation

2008-12-24 Thread Nature Lover
Hi! I am new to CakePHP and currently working on an e-commerce site having three models: User( id, name, joined) UserProfile( id, user_id, title, age, email ) UserContacts( id, user_id, name, address) Currently receiving data from a form as below: $this->data['User']['name'] $this->data['UserP

Re: Saving Multiple Models in one save

2008-12-24 Thread sijo jose
Well sorry for not being prompt, Presently cakePHP supports saving models upto level one only. So I have changed my code accordingly. Thanks for your reply which was helpfull. Regards Sijo On Wed, Dec 10, 2008 at 2:52 PM, WebbedIT wrote: > > I haven't gotten around to using saveAll() as yet, b

Re: A table with average & total row

2008-12-24 Thread Dr. Tarique Sani
On Tue, Dec 23, 2008 at 11:01 PM, mathie wrote: > > Hello, > > This is a design question on MVC separation. Say I need to display a > table with many rows, then a total and an average row. Should the > calculation of this total/average be done in the view (in the loop) or > in the controller (aft

Re: Cake Developers in Chennai, TamilNadu, India?

2008-12-24 Thread sijo jose
Yah i have been working for past 4 months. Regards Sijo On Thu, Dec 11, 2008 at 11:15 PM, ravindranathbe wrote: > > Hi > I am Ravindranath. Experienced in CakePHP for the past 10 months. > Able to create highly professional, high quality website on Cakephp. > You can contact me thro, > 1. email

Re: form helper -> inputs -> textarea -> cols?

2008-12-24 Thread sijo jose
Hey why cant u try the $form->input option. Its quiet easy. input('SamplingDetail.sampling_address', array('error'=>'Sampling Address cannot be left empty','div' => 'mandatory','type'=>'textarea','label' => 'Sampling Address', 'rows' => 3, 'cols' => 35)); ?> Regards Sijo On Fri, Dec 12, 2008 at

Re: Error Messages Not Displaying in View or in Validations Array

2008-12-24 Thread sijo jose
hi, As earlier said u are sending the form data to a different page... function thank_you() { > if( !empty($this->data) ) > { > $this->User->create(); > if( $this->User->save($this->data) ) > { > } > else > { > $this->redirect(array('action' => 'index'),n

Bulk or Mass Email in CakePHP

2008-12-24 Thread Ammad
I want to send out 1000's of emails in CakePHP and I am using PHP Mailer with it. I would like you people to share you thoughts on is: What I should do? Whats the best solution in your view? What to do in case of script time out errors? Thanks and regards, Muhammad Ammad Saleem BS (Computer Scie

Re: How to validate 2 linked models created from one form?

2008-12-24 Thread sijo jose
Hi, Since u have created the form for the model Order, The field title should be referred like $form->input("Customer.title"); directly. Now when u r saving use saveAll $this->Order->saveAll($this->data,array('validate' => 'first')); All the validation rules can be in ur model itself. The ar

Re: A table with average & total row

2008-12-24 Thread dr. Hannibal Lecter
Depends. If you can do it in DB without performance loss, that's the best way. If not, view is good enough. I tend to do as much as possible in the database, because the damn thing is optimized to work with (large) sets of data. But in the end, if that's not an option for you, whatever gets the jo

Re: Auth.php redirect - Undefined variable redir

2008-12-24 Thread codershop
This issue was fixed by nate in revision 7954. On Dec 23, 4:11 pm, codershop wrote: > This has been submitted as bug #5921 > > https://trac.cakephp.org/ticket/5921 > > On Dec 22, 10:44 am,codershop wrote: > > > I am using revision 7949, on the > > branchhttps://svn.cakephp.org/repo/branches/1.2

Re: $html->url returns unexpected result when using named parameters.

2008-12-24 Thread Farhadi
I found this bug (https://trac.cakephp.org/ticket/4522) that is exactly what I mentioned. Currently, there is no plan to fix this problem, for now you can use this workaround: Place this line at your routes.php : Router::connectNamed(array('namedparam')); Notice that you must specify all of your

Re: custom SQL query - all values IN() bust be AND

2008-12-24 Thread dev
I will give an example: Advert hasMany Option I need to find Adverts, where its Options are 3 and 4 values. When using IN, it will return results with 3, or, 4, or both 3 and 4. But i want only with both values. Like: [0] => Array ( [Advert] => Array (

$html->url returns unexpected result when using named parameters.

2008-12-24 Thread Farhadi
Hi, I have defined a route: Router::connect('/:lang/:controller/:action/*', null, array ('lang'=>'[a-z]{2}')); when I want to create a link using $html->link if there was a named parameter in the url, the result is wrong. for example when I am in /en/groups/index, $html->url(array('lang'=>'en', '

Re: generatetreelist error in rc4

2008-12-24 Thread AD7six
"Undefined property: AppModel::$TicketCategory" means your TicketCategory model doesn't exist or isn't being found - and so an instance of AppModel is used instead (since the db table does exist). AD --~--~-~--~~~---~--~~ You received this message because you are