Re: access check not working for index page
Thanks Andy, that's much cleaner than testing for it explicitly like I suggested. Geoff On 8/24/07, AD7six <[EMAIL PROTECTED]> wrote: > > > > On Aug 24, 1:50 am, rtanz <[EMAIL PROTECTED]> wrote: > > any more help on this? thanks > > add CAKE_ADMIN => CAKE_ADMIN to your route > > Cake is looking for the presence of the array key to know if it's an > admin method - just putting 'admin' in your route won't work (that's > the same as 0 => 'admin' ). > > hth, > > AD > > > > > -- http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: access check not working for index page
On Aug 24, 1:50 am, rtanz <[EMAIL PROTECTED]> wrote: > any more help on this? thanks add CAKE_ADMIN => CAKE_ADMIN to your route Cake is looking for the presence of the array key to know if it's an admin method - just putting 'admin' in your route won't work (that's the same as 0 => 'admin' ). hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing from localhost to web server
If the link in your view looks something like '/myLink' , remove the '/' On 8/24/07, rtconner <[EMAIL PROTECTED]> wrote: > > Mod_rewrite on? > AllowOverride set to All? > > On Aug 23, 4:57 pm, rtanz <[EMAIL PROTECTED]> wrote: > > any help on this? thanks > > > > On Aug 23, 11:51 am, rtanz <[EMAIL PROTECTED]> wrote: > > > > > hi i have been developing my cake site on my localserver on my pc, now > > > when i uploaded it to the server my links are not working. On my pc > > > the address is > > > > >http://localhost/cake/ > > > > > and on my server it is > > > > >http://url/users/cojg/cake/ > > > > > so now what is happenning is that when i click a liink on my server it > > > directs tohttp://url/cakeandomits the /users/cojg part. Is there a > > > way i can solve this without having to change all the links manually? > > > > > thanks > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Changing the font size according to the field size
Hi , Please excuse me if this is a newbie question. I retrieve all the fields from the database using models & i get them through $users['User']['name']>name $users['User']['qualification'] > qualification and i display them thru the below statement in the view file Mr. The problem is, the length of [user][name] is varchar 30 & qualification is varchar 30. Some times, the User name is short---> eg Tom Sometimes the user name is lengthy ---> eg Michael Augustin Sarajevo silvers when the user name is normal, i can get it displayed correctly, but if it is lengthy, it wraps to the next line, & i need to avoid that. and if set the font size to small, short user names are also small, is there any way to change the size of the font dynamically, depending upon the number of characters entered in the username field? or any ideas on this will be helpful. please Thanks in advance Isaac Raja --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dynamic views
Travis, I don't have answer to your question. My advice is to build the simplest possible implementation of your idea and expand it as your knowledge and familiarity with cake increases. Good luck! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
can't use xampp on win XP SP2 ????????
Hi, I am still trying to use cakephp and I removed wamp and cakephp and installed xampp. I see that it says xampp won't work in winXP SP2. I was following instructions from David Golding's Blog and of Ninja vs. Penguin in using xampp> Is there a more detailed example to follow? I am having trouble withdescribing code to show cakephp code will be found in defining "ROOT, APP_DIR, and CAKE_CORE_INCLUDE_PATH.. I find onlt one .haccess file. I see Rewrite Rule and RewriteCond and RewriteBase. Any help is good> Thanks, jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Advanced pagination problem. (Calling another controller by request handler)
Resolved: In the new controller, I added these line to the index function: function admin_index() { $this->paginate = array('limit' => 20); if(!isset($this->params['pass']['sort'])) $this->paginate['options'] ['sort'] = 'created'; else $this->paginate['options']['sort'] = $this->params['pass'] ['sort']; if(isset($this->params['pass']['direction'])) $this- >paginate['options']['direction'] = $this->params['pass'] ['direction']; $this->paginate['options']['controller']='sections'; $this->paginate['options']['action']='view'; $this->paginate['options'][]=$this->params['pass']['section']; } On Aug 24, 6:12 am, phpjoy <[EMAIL PROTECTED]> wrote: > I have a URL calling a controller, and that controller is calling > ANOTHER controller by requestAction. > > This is the URL I > have:http://localhost/admin/sections/view/175/page:1/sort:file/direction:asc > > I send the parameters to the new controller, and everything but the > direction works fine. > > When I click on the paginated link, it keeps putting "ASC" for the > options and not "DESC". > > If I change the URL to desc *manually*, it works. > URL:http://localhost/admin/sections/view/175/page:1/sort:file/direction:desc > > However, if it queries the DB for ASC, I'll still get 'ASC' on the > options [which isn't what's desired]. > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2 updateAll does no validation
On Aug 23, 10:17 pm, Dani <[EMAIL PROTECTED]> wrote: > Wouldn't it be cool if updateAll had a validate parameter just like > save? Hmm nope, not really. > By the way, what's the purpose of updateAll() if it's not save()-ing a > lot of rows at once? The difference is subtle but important. For example, try doing this with save() : UPDATE annoyances SET count = count + 1 WHERE description = "People second-guessing me" > Happy coding! > > On Aug 23, 3:40 pm, nate <[EMAIL PROTECTED]> wrote: > > > On Aug 23, 1:29 pm, Nico <[EMAIL PROTECTED]> wrote: > > > > I wanted to use Cake 1.2's validation (Model::validate) but it turns > > > out that Model->updateAllcalls directly db->update without doing any > > > validation whatsoever. Now I want to know if there are any plans for > > > including validation support onupdateAll > > > Probably not. The purpose ofupdateAll() is quite different from that > > of save(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Advanced pagination problem. (Calling another controller by request handler)
I have a URL calling a controller, and that controller is calling ANOTHER controller by requestAction. This is the URL I have: http://localhost/admin/sections/view/175/page:1/sort:file/direction:asc I send the parameters to the new controller, and everything but the direction works fine. When I click on the paginated link, it keeps putting "ASC" for the options and not "DESC". If I change the URL to desc *manually*, it works. URL: http://localhost/admin/sections/view/175/page:1/sort:file/direction:desc However, if it queries the DB for ASC, I'll still get 'ASC' on the options [which isn't what's desired]. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp and PostgreSQL
Version below 7.2 doesn't yet use information_schema thing so if you use such a bit older version you'd need to do something... On Aug 23, 4:48 am, michael lucas <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using cakephp with mysql right now, which is really simple also > due to mysql "describe" function that tell cakephp how my tables look. > I know that PostgreSQL lack "describe" function. So when I change my > dbms to PostgreSQL will it mean that I have to specify in some cakephp > configuration file how my tables are constructed? > > Or will cakephp use some nifty method to obtain from postgresql > informations about table? If so, I'm pretty interested how is this > done? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2 updateAll does no validation
Wouldn't it be cool if updateAll had a validate parameter just like save? By the way, what's the purpose of updateAll() if it's not save()-ing a lot of rows at once? Happy coding! On Aug 23, 3:40 pm, nate <[EMAIL PROTECTED]> wrote: > On Aug 23, 1:29 pm, Nico <[EMAIL PROTECTED]> wrote: > > > I wanted to use Cake 1.2's validation (Model::validate) but it turns > > out that Model->updateAllcalls directly db->update without doing any > > validation whatsoever. Now I want to know if there are any plans for > > including validation support onupdateAll > > Probably not. The purpose ofupdateAll() is quite different from that > of save(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using prepare and execute for oracle support in cakePHP
Hi, Does any one know any thing about how I can use prepare and execute in "cake_1.2.0.5427alpha" for oracle, and does it at all support using prepare and execute functionality? Regards, Maryam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: findAll with fields not working
ok, it seems that the problem was the escaping titles, thanks man --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: access check not working for index page
any more help on this? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
problem with invalidate
hi i have the following which my logic tells me should not save if a module with the same code is already saved in the database. Now when i test it i can see that it is finding a matching code and entering into the if ($this->Module->find($conditions) statement, and i assume therefore invalidating the code field. However it saves while as i was reading in the manual it is not supposed to save after i set the invalidate. so anyone knows what i might be doing wrong here? thanks function admin_add() { if (empty($this->data)) { $this->render(); } else { $this->cleanUpFields(); $module = $this->data['Module']['code']; $conditions = array("Module.code"=>"$module"); if ($this->Module->find($conditions)) { $this->Module->invalidate('code'); } if ($this->Module->save($this->data)) { $this->admin_createReview($this->Module- >getLastInsertId(), $this->data['Module']['code'],$this->data['Module'] ['name'],$this->data['Module']['year_delivered']); $this->Session->setFlash('The Module has been saved and an associated review created'); $this->redirect('/admin/modules/index'); } else { $this->Session->setFlash('Please correct errors below.'); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
problem with invalidate
hi i have the following which my logic tells me should not save if a module with the same code is already saved in the database. Now when i test it i can see that it is finding a matching code and entering into the if ($this->Module->find($conditions) statement, and i assume therefore invalidating the code field. However it saves while as i was reading in the manual it is not supposed to save after i set the invalidate. so anyone knows what i might be doing wrong here? thanks function admin_add() { if (empty($this->data)) { $this->render(); } else { $this->cleanUpFields(); $module = $this->data['Module']['code']; $conditions = array("Module.code"=>"$module"); if ($this->Module->find($conditions)) { $this->Module->invalidate('code'); } if ($this->Module->save($this->data)) { $this->admin_createReview($this->Module- >getLastInsertId(), $this->data['Module']['code'],$this->data['Module'] ['name'],$this->data['Module']['year_delivered']); $this->Session->setFlash('The Module has been saved and an associated review created'); $this->redirect('/admin/modules/index'); } else { $this->Session->setFlash('Please correct errors below.'); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused
Chris & Sam, I have read that page quite a few times, I'm not sure how I missed that section before. Must have been using the anchors too much. Thanks for your help. - Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused
read the models section of the documentation it will probably help a lot http://manual.cakephp.org/chapter/models Sam D On 8/23/07, Jimbo2150 <[EMAIL PROTECTED]> wrote: > > On Aug 23, 4:53 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > On 8/23/07, Jimbo2150 <[EMAIL PROTECTED]> wrote: > > > > > It says that 'downloader_files_tags' table does not exist, but it > > > should not be looking for a '_files_tags' table. Just a '_tags' table. > > > > You need a join table if you are going to create a HABTM association. > > > > Thanks. I realized that about 5 minutes after I posted the message. I > was confused because it wasn't specifically declared anywhere. Is > there any way to select a different table for that join? > > - Jim > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused
On Aug 23, 4:53 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 8/23/07, Jimbo2150 <[EMAIL PROTECTED]> wrote: > > > It says that 'downloader_files_tags' table does not exist, but it > > should not be looking for a '_files_tags' table. Just a '_tags' table. > > You need a join table if you are going to create a HABTM association. > Thanks. I realized that about 5 minutes after I posted the message. I was confused because it wasn't specifically declared anywhere. Is there any way to select a different table for that join? - Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing from localhost to web server
Mod_rewrite on? AllowOverride set to All? On Aug 23, 4:57 pm, rtanz <[EMAIL PROTECTED]> wrote: > any help on this? thanks > > On Aug 23, 11:51 am, rtanz <[EMAIL PROTECTED]> wrote: > > > hi i have been developing my cake site on my localserver on my pc, now > > when i uploaded it to the server my links are not working. On my pc > > the address is > > >http://localhost/cake/ > > > and on my server it is > > >http://url/users/cojg/cake/ > > > so now what is happenning is that when i click a liink on my server it > > directs tohttp://url/cakeandomits the /users/cojg part. Is there a > > way i can solve this without having to change all the links manually? > > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing from localhost to web server
any help on this? thanks On Aug 23, 11:51 am, rtanz <[EMAIL PROTECTED]> wrote: > hi i have been developing my cake site on my localserver on my pc, now > when i uploaded it to the server my links are not working. On my pc > the address is > > http://localhost/cake/ > > and on my server it is > > http://url/users/cojg/cake/ > > so now what is happenning is that when i click a liink on my server it > directs tohttp://url/cakeand omits the /users/cojg part. Is there a > way i can solve this without having to change all the links manually? > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: call validation on single field
if ( !preg_match(VALID_EMAIL, $email_address) ){ // not a valid email } will manually check a single email address. On Aug 24, 8:27 am, Claudia <[EMAIL PROTECTED]> wrote: > Hi there > > Is there a way to ask Cake to validate only a single field (opposed to > validating all fields that are mentioned in the $validate array) ? > > I use a model without a table to make use of the validation features > of cake when sending an email. Now I would like to validate an array > of email addresses but the validation rule works only on single email > addresses. Therefore I thought about writing a custom validation rule > that iterates through the array and validates each email address on > its own but I don't know how to call the Cake validation for emails > manually. > Also sometimes I want to validate only a few fields whereas another > time I would like to validate all fields. This could be easily > achieved if it is possible to tell Cake which fields to validate. > > I am using Cake 1.2 > > Thanks > > Claudia --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: findAll with fields not working
Since the error is "invalid column name `name`", are you sure that the User.name field exists in the database? Put your DEBUG to 2, and check that the field titles are being escaped in the query properly (ie `User`.`name` not just User.name) as "name" is probably a reserved word unless escaped. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 ACL problem
using Ketan's guide i got "class Aro not found" error. what could be the problem? im using 1.2 On Jul 16, 6:44 pm, "Christopher E. Franklin, Sr." <[EMAIL PROTECTED]> wrote: > Any idea how long these articles take to be approved? I guess > they(whoever they are) are checking for accuracy. > > On Jul 13, 7:11 am, Ketan Patel <[EMAIL PROTECTED]> wrote: > > > I have written an article on 'How to useAclin1.2x' which is pending > > approval on bakery. I don't know if you could access it, though the > > url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x > > > Let me know if it helps you. > > > Ketan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
findAll with fields not working
Hello guys, I'm trying to retrieve all records from a table an its related models using findAll, which works fine but the query retrieves all fields, so that I decided to use the fields parameter in findAll method but it's not working: this is my code: $fields = array('Appointment.id', 'Appointment.user_id', 'Appointment.created', 'User.name', 'User.lastname'); $data = $this->Appointment->findAll(null, $fields, 'Appointment.id', 20); This is what I get: Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'name'. (severity 16) in /var/www/apache2-default/infolab/cake/ libs/model/dbo/dbo_mssql.php on line 162 I'm using MSSQL as database, the relation between models are: An appointment belongs to a user, and a user has many appointments. If I don't pass $fields parameter the query executes well. What I'm I doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 ACL problem
Hi Ketan! I'm having difficulties with your tutorial. I'm having this error: "class 'Aro' not found". And i'm using cake 1.2. if i use $this -> Acl -> Aco -> create(array('alias' => 'controllers')); then i get "Fatal error: Call to a member function create() on a non- object in web/cake/app/controllers/init_acl_controller.php on line 13" so how can i resolve this? On Jul 13, 5:11 pm, Ketan Patel <[EMAIL PROTECTED]> wrote: > I have written an article on 'How to useAclin1.2x' which is pending > approval on bakery. I don't know if you could access it, though the > url ishttp://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x > > Let me know if it helps you. > > Ketan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
call validation on single field
Hi there Is there a way to ask Cake to validate only a single field (opposed to validating all fields that are mentioned in the $validate array) ? I use a model without a table to make use of the validation features of cake when sending an email. Now I would like to validate an array of email addresses but the validation rule works only on single email addresses. Therefore I thought about writing a custom validation rule that iterates through the array and validates each email address on its own but I don't know how to call the Cake validation for emails manually. Also sometimes I want to validate only a few fields whereas another time I would like to validate all fields. This could be easily achieved if it is possible to tell Cake which fields to validate. I am using Cake 1.2 Thanks Claudia --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: where to put independent functions
okie do! On 8/23/07, rtconner <[EMAIL PROTECTED]> wrote: > > > I'm pretty sure bootstrap.php was made to hold this type of single > function. > vendors is where you would would put it if you had a whole library you > wanted to use. > > On Aug 23, 2:59 pm, "Sonic Baker" <[EMAIL PROTECTED]> wrote: > > What's wrong with the Vendor directory? > > > > On 8/17/07, David Cole <[EMAIL PROTECTED]> wrote: > > > > > > > > > From my understanding, independent functions should go into their > > > respective > > > model file. That way you can call the function from the controller > like > > > $this->Model->func(). Right? > > > > > Dave > > > > > -Original Message- > > > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On > > > Behalf > > > Of luke BAKING barker > > > Sent: Friday, August 17, 2007 4:12 AM > > > To: Cake PHP > > > Subject: Re: where to put independent functions > > > > > why not jsut create an empty model? I was sure there was something > > > also in the controller you could put like $uses = null or > > > > > On Aug 16, 2:42 pm, rtanz <[EMAIL PROTECTED]> wrote: > > > > yep i understood perfectly, managed to implement it thanks > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help with a simple search form
Hello everybody, after baking and modifying the default MVC for my app, now I'd like to insert a simple search form for one of my models. The model is linked by a belongsTo relationship to three other tables, and contains a Date field. I'd like to find items specifying one or more of the other tables' id ('other_table_id = value') and that are in a given date range. I chose this approach, that doesn't seem to work well: I created a simple search method in the controller, that fills the right lists for the three other tables, and a search view that contains the three selects and two date fields. The form action is the index() method, that I modified to check if this->data is set. If it is set, I use the findAll() method with this->postConditions($this->data) as a parameter, but it doesn't find anything. From the three available selects, I chose only one element. What might I have done wrong? Moreover, this approach doesn't work if I have to input a start date and an end date for my date field, because the model will think that they are fields of the table. Can anyone suggest me a pattern for this kind of problem? I'm using Cake 1.1 Thanks in advance, and sorry for the long post and the poor english. :) Bye, -- [ Andrea Spadaccini - a.k.a. lupino3 - GLUGCT - from Catania - ICQ : 91528290 ] [ GPG ID: 5D41ABF0 - key on keyservers - Debian GNU / Linux - Kernel 2.6.18.4 ] [ Linux Registered User 313388 - a(dot)spadaccini(at)catania(dot)linux(dot)it ] [ The only price you pay for greatness is knowing that it can't last forever. ] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with page's path
Nobody can help me? :D On 17 Ago, 09:35, Andrea <[EMAIL PROTECTED]> wrote: > Hi everybody! > I have this kind of problem with cake: > > When I want to access to a specific view I use this path > format:http://localhost/APPNAME/index.php/CONTROLLER/VIEW/PARAMETERS > > but when I navigate into the page created for example with the bake, > the format is like this:http://localhost/books/edit/2 > > So I receive a not found error by the browser. > > I download yesterday the last stable versione of cake and I use MAMP > over a OSX. > I try to find something about this issue on the Internet but I can't > understand what's the matter... > > What I have to configure? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session doesn't die ... it just freezes!!
Tested with Firefox and IE .. same behaviour. About server configuration .. maybe. The development environment is CentOS 4.4, almost default install, running in a local vmware server console. Changed "KeepAlive", which is the only configuration parameter which seems kind of related, without success. Done some google with "+php +download +freeze" and "+apache +download +freeze" without founding anything interesting. Neither changing "freeze" for "block". In a few hours i will post controller, model and view to the bin. Thanks four your interest. On 23 ago, 21:23, nate <[EMAIL PROTECTED]> wrote: > This sounds more like a browser or webserver configuration issue. > > On Aug 23, 1:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Thanks for you answer!! > > > I've already set "Content-Disposition: attachment; filename=\"$filename > > \"", and also an option for the IE problem with multiple dots. > > > My first cake so at this stage I'm not using the Security component. > > CAKE_SECURITY set to 'high', also tested with 'medium' without > > success. I'm not sure of fully understanding your suggestion about > > Security and Session handling. > > > The session don't die as long as the download time is smaller than the > > session lifetime it simply freezes. After the download starts the > > user can request anything he wants. But the browser will not receive > > any data until the donwload is finished. Click for download, download > > starts, click on _put_any_number_here_ links from the page and finally > > when download finishes the last action requested is processed. > > > If you are downloading small files or working from intranet the user > > perhaps doesn't notice the behaviour, but downloading a 50MB file from > > the internet at 15KB/s you can imagine the result. For testing I > > download smaller than 1MB files at 10KB/s so the file size is not > > causing the problem. > > > Only the current session gets frozen. I've run tests with 3 or more > > concurrent sessions (downloading diferent files with diferent file > > sizes as 700kb or 170MB) and all of them freeze when the download > > starts and get back to life when it finishes. > > > I assume that when my controller action calls the model download > > method it doesn't give up until the method "return's". And the method > > does not "return" until the chunked "fread" ends due to "feof" > > condition. So what I need is something like "fire and forget" the > > method from the action, so the user can go on with other actions. > > > Thanks again, > > Juan > > > On 23 ago, 17:23, nate <[EMAIL PROTECTED]> wrote: > > > > Set the content-disposition header so the download gets forked out to > > > a separate request, and use Ajax on the main application page to keep > > > the session alive. Are you using the Security component? What are > > > your session security settings? > > > > On Aug 23, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > > > In my project the users will usually download files with sizes up to > > > > 150MB at limited speeds depending on the remote location (intranet/ > > > > internet), so the download process can take hours. I've created a > > > > download function in a model which is requested by a function in a > > > > controller. > > > > > The problem is that once the download begins, the application gets > > > > frozen and the user can't do any other action within this session > > > > until the download is finished. The desired behaviour would be that, > > > > while enough bandwith is available, the user can download several > > > > files simultaneously. > > > > > I've searched the group and done some google work without success. > > > > Perhaps the solution is not so complicated but I don't know how to fix > > > > this behaviour. > > > > > Any idea on how to solve this problem? Can you point me to a resource > > > > related to this issue? > > > > > Thanks, > > > > Juan > > > > > CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: where to put independent functions
I'm pretty sure bootstrap.php was made to hold this type of single function. vendors is where you would would put it if you had a whole library you wanted to use. On Aug 23, 2:59 pm, "Sonic Baker" <[EMAIL PROTECTED]> wrote: > What's wrong with the Vendor directory? > > On 8/17/07, David Cole <[EMAIL PROTECTED]> wrote: > > > > > From my understanding, independent functions should go into their > > respective > > model file. That way you can call the function from the controller like > > $this->Model->func(). Right? > > > Dave > > > -Original Message- > > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf > > Of luke BAKING barker > > Sent: Friday, August 17, 2007 4:12 AM > > To: Cake PHP > > Subject: Re: where to put independent functions > > > why not jsut create an empty model? I was sure there was something > > also in the controller you could put like $uses = null or > > > On Aug 16, 2:42 pm, rtanz <[EMAIL PROTECTED]> wrote: > > > yep i understood perfectly, managed to implement it thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: where to put independent functions
What's wrong with the Vendor directory? On 8/17/07, David Cole <[EMAIL PROTECTED]> wrote: > > > From my understanding, independent functions should go into their > respective > model file. That way you can call the function from the controller like > $this->Model->func(). Right? > > Dave > > -Original Message- > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On > Behalf > Of luke BAKING barker > Sent: Friday, August 17, 2007 4:12 AM > To: Cake PHP > Subject: Re: where to put independent functions > > > why not jsut create an empty model? I was sure there was something > also in the controller you could put like $uses = null or > > On Aug 16, 2:42 pm, rtanz <[EMAIL PROTECTED]> wrote: > > yep i understood perfectly, managed to implement it thanks > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need some help in understanding error messages
Model: function beforeValidate() { # for add -there is no id if (!isset($this->data[$this->name]['id']) && !empty($this- >data[$this->name]['name']) &&$this->hasAny("User.name='{$this- >data['User']['name']}' ) ) { $this->invalidate('name_unique'); } # for edit - there is id if (isset($this->data[$this->name]['id']) && !empty($this- >data[$this->name]['name']) && $this->findCount("User.name = '{$this- >data[$this->name]['name']}' ) { $this->invalidate('name_unique'); } return true; } View: tagErrorMsg('User/username', 'Please enter the Username.');?> tagErrorMsg('User/name_unique', 'Username exists...');?> On Aug 23, 10:49 pm, rtanz <[EMAIL PROTECTED]> wrote: > but what if i have more than one error? am i correct in that you can > have only one set flash message? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Confused
On 8/23/07, Jimbo2150 <[EMAIL PROTECTED]> wrote: > It says that 'downloader_files_tags' table does not exist, but it > should not be looking for a '_files_tags' table. Just a '_tags' table. You need a join table if you are going to create a HABTM association. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need some help in understanding error messages
but what if i have more than one error? am i correct in that you can have only one set flash message? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Confused
I have used this group and the Cake manual and they have been invaluable resources, but then I hit an odd snag. Here is the query that is output: SELECT `Tag`.`id`, `Tag`.`tagName` FROM `downloader_tags` AS `Tag` JOIN `downloader_files_tags` ON (`downloader_files_tags`.`file_id` = 1 AND `downloader_files_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1; It says that 'downloader_files_tags' table does not exist, but it should not be looking for a '_files_tags' table. Just a '_tags' table. Here is files_controller: class FilesController extends AppController { var $name = 'Files'; var $uses = array('File','Tag'); function display_new() { $this->set('test',$this->File->findAll()); $this->render('home'); } } Here is file (model): class File extends AppModel { var $name = 'File'; var $hasAndBelongsToMany = 'Tag'; } And tag (model): class Tag extends AppModel { var $name = 'Tag'; var $hasAndBelongsToMany = 'File'; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dynamic views
I'm not sure if that would work, that seems more like a way to load configuration values. I am trying to design my application so that a user can create different attributes (ie. First Name, Last Name, Age, City, or any other attribute) and link those attributes to certain types (String, Integer, Date, etc). They would also be able to create pages (ie. Contact Entry, Addresses) and link the attributes to a specific page. The attributes, types, and pages would be stored in different tables. There would also be some sort of data table in which values for these specific components were saved. The data table would look something like (ID, value, attribute_id) and the attribute table would look something like (ID, name, type_id). The page table would be along the lines of (ID, name) with an attribute/page table (ID, page_id, attribute_id). What I'm trying to figure out how to do is display a page along with it's attributes so that a user can enter data and store them in the data table. It would then need to validate the data based on the type of that attribute. On Aug 23, 1:39 pm, McFadly <[EMAIL PROTECTED]> wrote: > Hmmm... not sure I completely follow your question, but if I'm getting > the right impression the > ConfComponent:http://bakery.cakephp.org/articles/view/confcomponent-db-based-config... > is what you're looking for. I use it extensively, its a great > database based configuration tool. > > On Aug 23, 10:31 am, Travis <[EMAIL PROTECTED]> wrote: > > > I was wondering if there were any CakePHP based components that would > > allow me to build dynamic data entry views based on values in a > > database such that I can enter data and store it in a generic table. > > For example, if I have a table 'Attributes' that has an attribute > > name, and the type of attribute along with size/length specifications, > > I would like to create a view based on any number of those > > attributes. I would then like to enter values in and have the values > > stored in a 'Records' table that would link back to the original > > attribute ID. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: does cake have anything to help create a sortable grid?
On Aug 18, 11:01 pm, "Shunro Dozono" <[EMAIL PROTECTED]> wrote: > If you are using 1.1, try this:http://cakeforge.org/projects/decorate/ > > This is a extended bake.php. And you can modify as you like. > Shun This looks like what I want. Has anybody here ever used "decorate"? If so, what did you think of it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2 updateAll does no validation
On Aug 23, 1:29 pm, Nico <[EMAIL PROTECTED]> wrote: > I wanted to use Cake 1.2's validation (Model::validate) but it turns > out that Model->updateAll calls directly db->update without doing any > validation whatsoever. Now I want to know if there are any plans for > including validation support on updateAll Probably not. The purpose of updateAll() is quite different from that of save(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dynamic views
Hmmm... not sure I completely follow your question, but if I'm getting the right impression the ConfComponent: http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration-tutorial is what you're looking for. I use it extensively, its a great database based configuration tool. On Aug 23, 10:31 am, Travis <[EMAIL PROTECTED]> wrote: > I was wondering if there were any CakePHP based components that would > allow me to build dynamic data entry views based on values in a > database such that I can enter data and store it in a generic table. > For example, if I have a table 'Attributes' that has an attribute > name, and the type of attribute along with size/length specifications, > I would like to create a view based on any number of those > attributes. I would then like to enter values in and have the values > stored in a 'Records' table that would link back to the original > attribute ID. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
re:Cake PHP table with no auto increment column
I have two tables products(product_id- primary key , auto-increment) product_details(product_id - primary_key) product_id is the foreign key i dont want to have one more auto increment column in details table any one have same problem ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session doesn't die ... it just freezes!!
This sounds more like a browser or webserver configuration issue. On Aug 23, 1:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks for you answer!! > > I've already set "Content-Disposition: attachment; filename=\"$filename > \"", and also an option for the IE problem with multiple dots. > > My first cake so at this stage I'm not using the Security component. > CAKE_SECURITY set to 'high', also tested with 'medium' without > success. I'm not sure of fully understanding your suggestion about > Security and Session handling. > > The session don't die as long as the download time is smaller than the > session lifetime it simply freezes. After the download starts the > user can request anything he wants. But the browser will not receive > any data until the donwload is finished. Click for download, download > starts, click on _put_any_number_here_ links from the page and finally > when download finishes the last action requested is processed. > > If you are downloading small files or working from intranet the user > perhaps doesn't notice the behaviour, but downloading a 50MB file from > the internet at 15KB/s you can imagine the result. For testing I > download smaller than 1MB files at 10KB/s so the file size is not > causing the problem. > > Only the current session gets frozen. I've run tests with 3 or more > concurrent sessions (downloading diferent files with diferent file > sizes as 700kb or 170MB) and all of them freeze when the download > starts and get back to life when it finishes. > > I assume that when my controller action calls the model download > method it doesn't give up until the method "return's". And the method > does not "return" until the chunked "fread" ends due to "feof" > condition. So what I need is something like "fire and forget" the > method from the action, so the user can go on with other actions. > > Thanks again, > Juan > > On 23 ago, 17:23, nate <[EMAIL PROTECTED]> wrote: > > > Set the content-disposition header so the download gets forked out to > > a separate request, and use Ajax on the main application page to keep > > the session alive. Are you using the Security component? What are > > your session security settings? > > > On Aug 23, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > In my project the users will usually download files with sizes up to > > > 150MB at limited speeds depending on the remote location (intranet/ > > > internet), so the download process can take hours. I've created a > > > download function in a model which is requested by a function in a > > > controller. > > > > The problem is that once the download begins, the application gets > > > frozen and the user can't do any other action within this session > > > until the download is finished. The desired behaviour would be that, > > > while enough bandwith is available, the user can download several > > > files simultaneously. > > > > I've searched the group and done some google work without success. > > > Perhaps the solution is not so complicated but I don't know how to fix > > > this behaviour. > > > > Any idea on how to solve this problem? Can you point me to a resource > > > related to this issue? > > > > Thanks, > > > Juan > > > > CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need some help in understanding error messages
The easiest way to do this is by using $this->Session- >setFlash('Username already exists'); in your controller. The error message will show up at the top of the page or wherever you put "if ($session->check('Message.flash')) $session->flash();" in your layout. On Aug 23, 7:33 am, rtanz <[EMAIL PROTECTED]> wrote: > hi right now i have baked a model with an add and edit view as > automatically generated by cake. So now if I make any errors when > saving (as determined by the $validate conditions below) I will get > the values of the tagErrorMsg as set in the view. Now I also made a > beforeSave function that checks whether a user with that username > exists already, and in that case I would like to output a different > message saying that 'Username already exists' instead of 'Please enter > the Username'. How can i do this? thanks > > class User extends AppModel > { > var $name = 'User'; > var $hasMany = array('Membership'=>array('dependent'=>true)); > > var $validate = array( > 'username' => '/[a-z0-9\_\-]{3,}$/i', > 'password' => VALID_NOT_EMPTY, > 'email' => VALID_EMAIL, >); > > function beforeSave() { > $user = $this->data['User']['username']; > $conditions = array("User.username"=>"$user"); > if ($this->find($conditions)) { > return false; > } > else return true; > } > > } > > tagErrorMsg('User/username', 'Please enter the > Username.');?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session doesn't die ... it just freezes!!
Can you post your controller method and view to see what we've got here? This is very intriguing to me. On Aug 23, 10:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks for you answer!! > > I've already set "Content-Disposition: attachment; filename=\"$filename > \"", and also an option for the IE problem with multiple dots. > > My first cake so at this stage I'm not using the Security component. > CAKE_SECURITY set to 'high', also tested with 'medium' without > success. I'm not sure of fully understanding your suggestion about > Security and Session handling. > > The session don't die as long as the download time is smaller than the > session lifetime it simply freezes. After the download starts the > user can request anything he wants. But the browser will not receive > any data until the donwload is finished. Click for download, download > starts, click on _put_any_number_here_ links from the page and finally > when download finishes the last action requested is processed. > > If you are downloading small files or working from intranet the user > perhaps doesn't notice the behaviour, but downloading a 50MB file from > the internet at 15KB/s you can imagine the result. For testing I > download smaller than 1MB files at 10KB/s so the file size is not > causing the problem. > > Only the current session gets frozen. I've run tests with 3 or more > concurrent sessions (downloading diferent files with diferent file > sizes as 700kb or 170MB) and all of them freeze when the download > starts and get back to life when it finishes. > > I assume that when my controller action calls the model download > method it doesn't give up until the method "return's". And the method > does not "return" until the chunked "fread" ends due to "feof" > condition. So what I need is something like "fire and forget" the > method from the action, so the user can go on with other actions. > > Thanks again, > Juan > > On 23 ago, 17:23, nate <[EMAIL PROTECTED]> wrote: > > > Set the content-disposition header so the download gets forked out to > > a separate request, and use Ajax on the main application page to keep > > the session alive. Are you using the Security component? What are > > your session security settings? > > > On Aug 23, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > In my project the users will usually download files with sizes up to > > > 150MB at limited speeds depending on the remote location (intranet/ > > > internet), so the download process can take hours. I've created a > > > download function in a model which is requested by a function in a > > > controller. > > > > The problem is that once the download begins, the application gets > > > frozen and the user can't do any other action within this session > > > until the download is finished. The desired behaviour would be that, > > > while enough bandwith is available, the user can download several > > > files simultaneously. > > > > I've searched the group and done some google work without success. > > > Perhaps the solution is not so complicated but I don't know how to fix > > > this behaviour. > > > > Any idea on how to solve this problem? Can you point me to a resource > > > related to this issue? > > > > Thanks, > > > Juan > > > > CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Storing Site Preferences
> FWIW, it doesn't seems a nice option. After taking it in our project > we're scratching our heads as there doesn't seem to be a right way to > access the config values in models, views and components. Did you find a way how to set e.g. $this->Config and access it from Ms&Cs ? I've got a configuration variable which contents are merged from variables defined in a file (loaded by Configure::read()) and from user preferences stored in db. Therefore I need to do this from within AppController or AppModel where I have access to the database... Don't know which would be the right place either for this func... Is there anyway to make this variable accessible from Models and Controllers??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
1.2 updateAll does no validation
I wanted to use Cake 1.2's validation (Model::validate) but it turns out that Model->updateAll calls directly db->update without doing any validation whatsoever. Now I want to know if there are any plans for including validation support on updateAll, or if there's another way of doing it (better than updating row by row calling Model->save for each). Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Session doesn't die ... it just freezes!!
Thanks for you answer!! I've already set "Content-Disposition: attachment; filename=\"$filename \"", and also an option for the IE problem with multiple dots. My first cake so at this stage I'm not using the Security component. CAKE_SECURITY set to 'high', also tested with 'medium' without success. I'm not sure of fully understanding your suggestion about Security and Session handling. The session don't die as long as the download time is smaller than the session lifetime it simply freezes. After the download starts the user can request anything he wants. But the browser will not receive any data until the donwload is finished. Click for download, download starts, click on _put_any_number_here_ links from the page and finally when download finishes the last action requested is processed. If you are downloading small files or working from intranet the user perhaps doesn't notice the behaviour, but downloading a 50MB file from the internet at 15KB/s you can imagine the result. For testing I download smaller than 1MB files at 10KB/s so the file size is not causing the problem. Only the current session gets frozen. I've run tests with 3 or more concurrent sessions (downloading diferent files with diferent file sizes as 700kb or 170MB) and all of them freeze when the download starts and get back to life when it finishes. I assume that when my controller action calls the model download method it doesn't give up until the method "return's". And the method does not "return" until the chunked "fread" ends due to "feof" condition. So what I need is something like "fire and forget" the method from the action, so the user can go on with other actions. Thanks again, Juan On 23 ago, 17:23, nate <[EMAIL PROTECTED]> wrote: > Set the content-disposition header so the download gets forked out to > a separate request, and use Ajax on the main application page to keep > the session alive. Are you using the Security component? What are > your session security settings? > > On Aug 23, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Hello, > > > In my project the users will usually download files with sizes up to > > 150MB at limited speeds depending on the remote location (intranet/ > > internet), so the download process can take hours. I've created a > > download function in a model which is requested by a function in a > > controller. > > > The problem is that once the download begins, the application gets > > frozen and the user can't do any other action within this session > > until the download is finished. The desired behaviour would be that, > > while enough bandwith is available, the user can download several > > files simultaneously. > > > I've searched the group and done some google work without success. > > Perhaps the solution is not so complicated but I don't know how to fix > > this behaviour. > > > Any idea on how to solve this problem? Can you point me to a resource > > related to this issue? > > > Thanks, > > Juan > > > CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Dynamic views
I was wondering if there were any CakePHP based components that would allow me to build dynamic data entry views based on values in a database such that I can enter data and store it in a generic table. For example, if I have a table 'Attributes' that has an attribute name, and the type of attribute along with size/length specifications, I would like to create a view based on any number of those attributes. I would then like to enter values in and have the values stored in a 'Records' table that would link back to the original attribute ID. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Long downloads freeze the session
Set the content-disposition header so the download gets forked out to a separate request, and use Ajax on the main application page to keep the session alive. Are you using the Security component? What are your session security settings? On Aug 23, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > In my project the users will usually download files with sizes up to > 150MB at limited speeds depending on the remote location (intranet/ > internet), so the download process can take hours. I've created a > download function in a model which is requested by a function in a > controller. > > The problem is that once the download begins, the application gets > frozen and the user can't do any other action within this session > until the download is finished. The desired behaviour would be that, > while enough bandwith is available, the user can download several > files simultaneously. > > I've searched the group and done some google work without success. > Perhaps the solution is not so complicated but I don't know how to fix > this behaviour. > > Any idea on how to solve this problem? Can you point me to a resource > related to this issue? > > Thanks, > Juan > > CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Installation problem on a sahred server
Hello everyone, I am trying to install a Cake application on a server. It was developed on my PC and worked fine with the standard distribution - no changes to .htaccess or directory structure. Now I have copied the whole cake directory into the www directory on my server. Problem is that the CSS and JS included files are not loaded. I have checked in the source html and here is an example of what is in there: ... And here is what is in the source produced my development PC - where it works fine: ... As you can see the path is not correctly set by the Html helper on the production server for CSS, Image and Form. Apart from that, the page is displayed and it seems that mod_rewrite works fine. Thanks for your help! Owki --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Edit form is not saving data
you need to set the id of the record you are saving explicitly eg. $this->model->id = $this->data['model']['id']; // sets the id so cake knows you are replacing and not creating a new one $this->model->save($this->data); On Aug 23, 7:52 pm, PardeepSharma <[EMAIL PROTECTED]> wrote: > I have form of addlisting in which I am adding the Real estate list > and when I am editing this page, happening is that the I am not > editing the file input field and click submit but it replaces file > input values to null so how I did stop to not save null as store its > dstabase value which is loaded when form loads... Any solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Url linking and truncate
I wish to truncate my url/emails in case they gets too long(usually url) and affect my view layouts. However, i cant find any options in the autolinkurl function to truncate in the text helper. and if i had used truncate on the original url, the location will also be cut off as well. I would need to use the autolink because i wont know if the user is going to put url or just normal text in the field or even their email. Any one has any solution to this problem ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp and PostgreSQL
PostgreSQL has a columns table inside information_schema (which is an internal schema, so it might be hidden). The individual database drivers normalize the results so Cake sees them in the same way. On Aug 23, 4:48 am, michael lucas <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using cakephp with mysql right now, which is really simple also > due to mysql "describe" function that tell cakephp how my tables look. > I know that PostgreSQL lack "describe" function. So when I change my > dbms to PostgreSQL will it mean that I have to specify in some cakephp > configuration file how my tables are constructed? > > Or will cakephp use some nifty method to obtain from postgresql > informations about table? If so, I'm pretty interested how is this > done? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Long downloads freeze the session
Hello, In my project the users will usually download files with sizes up to 150MB at limited speeds depending on the remote location (intranet/ internet), so the download process can take hours. I've created a download function in a model which is requested by a function in a controller. The problem is that once the download begins, the application gets frozen and the user can't do any other action within this session until the download is finished. The desired behaviour would be that, while enough bandwith is available, the user can download several files simultaneously. I've searched the group and done some google work without success. Perhaps the solution is not so complicated but I don't know how to fix this behaviour. Any idea on how to solve this problem? Can you point me to a resource related to this issue? Thanks, Juan CakePHP/1.1.16 on Apache/2.0.52 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple connections
On 8/23/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > Yes. And also need different condition for each one. Is that possible ? > > > > Well, how would you do this if you weren't using CakePHP. I think > that will answer your question. I would loop for each row of first query and query the other database. > > (I'll give you a hint - look into how to create different database > configurations and how to tell your model to use the non-default one) Actually I have done it and it working great with hasOne association. Even I can do a sort of it. The only drawback is I cannot have query condition for both models. I can only do that in main model. To make it clear I better write down my code :) --- class DATABASE_CONFIG { var $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', 'login' => 'cakeuser', 'password' => 'mycakepass', 'database' => 'cakedb', 'prefix' => '' ); var $mssqlconn = array( 'driver' => 'mssql', 'persistent' => false, 'host' => 'localhost', 'login' => 'sa', 'password' => 'somepassword', 'database' => 'CustomerDB', 'prefix' => '' ); } --- --- Model : Customer --- array('className' => 'Sales', 'foreignKey' => 'sales_id', 'conditions' => '', 'fields' => '', 'order' => '', 'counterCache' => ''), ); } ?> --- --- Model : Sales --- array('className' => 'Customer', 'foreignKey' => 'customer_id', 'conditions' => '', 'fields' => '', 'order' => '', 'counterCache' => ''), ); } ?> --- And then I have them paginated in my view. With model condition like below : $conditions=> array('Sales.id'=>'123') $this->paginate('Sales', $conditions). it is woking fine. But when I need to have conditions for both models. === $conditions=>array('Sales.id'=>'123', 'Customer.sales_id'=>'123'). $this->paginate('Sales', $conditions). === It generates error . Then I take a look at the debug sql output. And it seems that cakephp join Sales & Customer during sql call instead of separating them for each queries which it does for 'pagination' process. I still try to get better understanding with cakephp core lib code for pagination. But meanwhile I try to post it here if somebody has any experience with this kind of 'problem', has resolved it and can help me with that :) Hope that I make myself clear enough :P > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > Best Regards, Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
need some help in understanding error messages
hi right now i have baked a model with an add and edit view as automatically generated by cake. So now if I make any errors when saving (as determined by the $validate conditions below) I will get the values of the tagErrorMsg as set in the view. Now I also made a beforeSave function that checks whether a user with that username exists already, and in that case I would like to output a different message saying that 'Username already exists' instead of 'Please enter the Username'. How can i do this? thanks class User extends AppModel { var $name = 'User'; var $hasMany = array('Membership'=>array('dependent'=>true)); var $validate = array( 'username' => '/[a-z0-9\_\-]{3,}$/i', 'password' => VALID_NOT_EMPTY, 'email' => VALID_EMAIL, ); function beforeSave() { $user = $this->data['User']['username']; $conditions = array("User.username"=>"$user"); if ($this->find($conditions)) { return false; } else return true; } } tagErrorMsg('User/username', 'Please enter the Username.');?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
No UTF-8 excepted in parameter (url).
Hi.. I think I came across a bug while developing with 1.2.0.5427alpha. I didn't want to post this on the trac before I was sure. Here's my problem... I'm developing an application, actually a simple wiki where I tried to get the page name as a parameter. So if i wanted to get a page named 'My page' I try to access it like 'wiki/display/My_page'. This works when there are no non-ASCII characters in the page name. But when I try access with UTF-8 characters in the parameter like ğ, ü, ş, i, ö, ç, ... I can't access those pages. Non ASCII characters seems to get deleted. I wrote a little test controller where the problem can be easily seen.. char_tests_controller.php set('parameter',$parameter); else $this->set('parameter',"No parameter!?!"); return; } } ?> test.ctp try "/char_tests/test/paremeter test" and "parameter test" comes up. then try "char_tests/test/öçşğü" and "No parameter!?!" comes up where it should display "öçşğü" Any comments appreciated... Thanks... Burak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple connections
On 8/23/07, Feris Thia <[EMAIL PROTECTED]> wrote: > > On 8/23/07, Dinh <[EMAIL PROTECTED]> wrote: > > I think that I dont really understand what you means. You want to join the > > tables at the different database server engines, dont you? > > > > Yes. And also need different condition for each one. Is that possible ? > Well, how would you do this if you weren't using CakePHP. I think that will answer your question. (I'll give you a hint - look into how to create different database configurations and how to tell your model to use the non-default one) -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple connections
On 8/23/07, Dinh <[EMAIL PROTECTED]> wrote: > I think that I dont really understand what you means. You want to join the > tables at the different database server engines, dont you? > Yes. And also need different condition for each one. Is that possible ? Regards, Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple connections
I think that I dont really understand what you means. You want to join the tables at the different database server engines, dont you? On 8/23/07, Feris Thia <[EMAIL PROTECTED]> wrote: > > > On 8/23/07, Grant Cox <[EMAIL PROTECTED]> wrote: > > > > $conditions=>array('OR' => array('Sales.id'=>'123', > > 'Customer.sales_id'=>'123') ); > > > > will use a boolean OR rather than AND. > > > > > > Hi Grant, > > I understand the OR condition, but that is not the situation I want. > What I need is to have the 'Customer.sales_id'=>'123' condition to be > applied to MSSQL connection as Customer model (table) is there. How > should I write condition to have that solution ? > > Regards, > > Feris > > > > -- Nobody in nowhere --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple connections
On 8/23/07, Grant Cox <[EMAIL PROTECTED]> wrote: > > $conditions=>array('OR' => array('Sales.id'=>'123', > 'Customer.sales_id'=>'123') ); > > will use a boolean OR rather than AND. > > Hi Grant, I understand the OR condition, but that is not the situation I want. What I need is to have the 'Customer.sales_id'=>'123' condition to be applied to MSSQL connection as Customer model (table) is there. How should I write condition to have that solution ? Regards, Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Notice: Undefined variable: transactions
Thanks i got my answer. :) On Aug 22, 5:15 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > Don't put a $ in the set call. > > $this->set('transactions', $this->Transaction->findAll(array('user_id' > => $userId))); > > On Aug 22, 9:01 pm,nirmal<[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am getting error on web page: > > > Notice: Undefined variable: transactions in /home/codewalla/work/ > > decktrade/src/webapp/www/app/views/users/transaction.thtml on line 28 > > > Warning: Invalid argument supplied for foreach() in /home/codewalla/ > > work/decktrade/src/webapp/www/app/views/users/transaction.thtml on > > line 28 > > > Code in controler: > > function transaction() { > > $userId = $this->_loadUserId(); > > ini_set("max_execution_time",60); > > ini_set( 'memory_limit', '64M' ); > > $this->set('$transactions', > > $this->Transaction->findAll(array > > ('user_id' => $userId))); > > } > > > Code in thtml: > > > > > > > href=""> > td> > > > > $ > getEarnings($transaction['Transaction']['amount']) ?> > > > number_format($transaction['Transaction']['status']); ?> > > > > > > Please help me. > > > -- > >Nirmal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting Forbidden Error with Ajax
Hi All, The problem is solved, it was due to the Encoding Method. got solution from jacet's post @ http://surmunity.com/showthread.php?t=22080 Just need to change one line in the prototype.js file, In Prototype code (class Ajax.Request.Events method setRequestHeaders) from: headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); to: headers['Content-type'] = this.options.contentType; that should work well. On Aug 23, 1:13 pm, "maulik.9" <[EMAIL PROTECTED]> wrote: > Hi All, > > I am getting some weird problem and have no clue what to do. > Here is the Situation: > > I have added two select boxes for province and city, the city box gets > populated once the user selects the province. I have > referredhttp://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... > and it works well in my local system(windows 2003 server). > > Now when i uploaded this application on the server, this part is not > working. When i tried to debug code, in prototype.js giving alert on > the server response text gives me text that "You don't have permission > to access {file name} on this server. " > > The Path of the file is valid and opening that in browser gives the > output. > > should i be making any changes in the configuration file while > uploading the application on the server ? > > Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database constraint violation using save()
Also spotted this method today: http://cakeexplorer.wordpress.com/2007/08/23/cakephp-12-custom-validation-unique-behavior/ On Aug 23, 9:58 am, RichardAtHome <[EMAIL PROTECTED]> wrote: > http://bakery.cakephp.org/articles/view/checking-for-duplicate-record... > > On Aug 23, 9:39 am, Deniz Chaban <[EMAIL PROTECTED]> wrote: > > > Hi. I have a UNIQUE contraint on one of my fields in my database > > table. > > > When using save() sometimes this constraint gets violated. MySQL then > > returns an exception. How do I catch this exception so that I can show > > the user a good error message? > > > I do not want to make a select query to see if that value is not > > already in use before calling to save. > > > I can't find any information about this anywhere. Maybe this is just > > impossible with PHP. I'm using cake 1.2 and PHP > 4.3. > > > Thanks, > > Deniz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Edit form is not saving data
Are you sure to have an hidden field for the id of the record ? On Aug 23, 1:52 pm, PardeepSharma <[EMAIL PROTECTED]> wrote: > I have form of addlisting in which I am adding the Real estate list > and when I am editing this page, happening is that the I am not > editing the file input field and click submit but it replaces file > input values to null so how I did stop to not save null as store its > dstabase value which is loaded when form loads... Any solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Edit form is not saving data
I have form of addlisting in which I am adding the Real estate list and when I am editing this page, happening is that the I am not editing the file input field and click submit but it replaces file input values to null so how I did stop to not save null as store its dstabase value which is loaded when form loads... Any solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: access check not working for index page
ok so now i modified as follows but still this is not working, i checked using debug and url is indeed shown as admin however user is still allowed access to this page function beforeFilter() { $this->checkSession(); //debug($this->params['url']); if (!empty($this->params[CAKE_ADMIN]) || $this->params['url'] == "admin") { //if (!empty($this->params[CAKE_ADMIN])){ $user = $this->Session->read('User'); $result = $this->User->findByUsername($user['username']); //print_r($result['User']['user_level']); //$user = $this->Entry->User->read(null, $user['id']); //debug($result); if ($result['User']['user_level'] <> 'admin') { $this->Session->setFlash('Access Denied.'); $this->redirect('/'); //$this->layout = "default"; } // set our layout based on admin routing vars $this->layout = "admin"; } } any other ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
correct way to do this check
hi i would like to make a check in my memberships model so that before a save there will be a check to eliminate duplicate entries. i have managed to do this using the following code in the membership model: function beforeSave() { $role = $this->data['Membership']['role_id']; $module = $this->data['Membership']['module_id']; $user = $this->data['Membership']['user_id']; $conditions = array("Membership.role_id"=>"$role","Membership.module_id"=>"$module","Membership.user_id"=>"$user"); if ($this->find($conditions)) { return false; } else return true; } however i would like to know if there is a neater way to do this thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: access check not working for index page
if (!empty($this->params[CAKE_ADMIN]) || $this->params['url'] == "admin") That should do it, the admin route that you created bypasses the CAKE_ADMIN feature so you have to explicitly test for it. Geoff On 8/23/07, rtanz <[EMAIL PROTECTED]> wrote: > > > this is how im doing my check > > if (!empty($this->params[CAKE_ADMIN])){ > $user = $this->Session->read('User'); > $result = $this->User->findByUsername($user['username']); > //print_r($result['User']['user_level']); > //$user = $this->Entry->User->read(null, > $user['id']); > if ($result['User']['user_level'] <> 'admin') { > $this->Session->setFlash('Access > Denied.'); > $this->redirect('/'); > } > // set our layout based on admin routing vars > $this->layout = "admin"; > > as you said im using params, how can i modify to also trap the manual > route? > > thnx > > > > > -- http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Perfomance Tunning your site
Hi i have found a perfomance tunning ur site article its really useful one http://www.discussweb.com/web-design-help/3182-website-performance-tips- tricks.html Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to integrate cakephp with wordpress and wikimedia
i am new in cake .. i want to know how to integrate wordpess blog and wikimedia in cakephp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cakePHP powered community - suggestions for foundation
Hello guys, I've done a few apps now with cake, now I've got a request for a community. I'm thinking to realize that with cakephp but I'm not really convinced to implement all of it from ground up. I kinda hate Joomla, so jake is no alternative. I read about drake, drupal with cake, which seemed pretty nice to me. But i took a look into drupals code... and I'm pretty scared since it is not OOP. So what would you guys recommend as a good foundation for a cake- powered community? Thanks and best regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
changing from localhost to web server
hi i have been developing my cake site on my localserver on my pc, now when i uploaded it to the server my links are not working. On my pc the address is http://localhost/cake/ and on my server it is http://url/users/cojg/cake/ so now what is happenning is that when i click a liink on my server it directs to http://url/cake and omits the /users/cojg part. Is there a way i can solve this without having to change all the links manually? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: access check not working for index page
this is how im doing my check if (!empty($this->params[CAKE_ADMIN])){ $user = $this->Session->read('User'); $result = $this->User->findByUsername($user['username']); //print_r($result['User']['user_level']); //$user = $this->Entry->User->read(null, $user['id']); if ($result['User']['user_level'] <> 'admin') { $this->Session->setFlash('Access Denied.'); $this->redirect('/'); } // set our layout based on admin routing vars $this->layout = "admin"; as you said im using params, how can i modify to also trap the manual route? thnx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
form-> input values
Hello List, I'm gettin' Problems with the $form->input select tag. I've got a simple integer field, that should filled with numbers 1-10. So I want use my own keys in a select Box. example: $form->input('objektart',array('type'=>'select','empty'=>'Bitte wählen')); I just don't know how to put the values in it. This doesn't work: $form->input('objektart',array('type'=>'select','empty'=>'Bitte wählen','value'=>'array('0'=>'my','1'=>'todo')')); Second problem is the empty field, the german "ä" is displayed as a question mark, the "ä"-html code is displayed as "ä" ... How could I display this character ?! Thx for your help, and sorry pour my poor english ... olsen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Newbie: Split form accross three views ?
Ok, thx, it was a manual job ... olsen Am 21.08.2007 um 15:27 schrieb MrTufty: > > It's possible to do anything with Cake that you can with standard PHP > and then some. > > Depending on how you wanted it to work, you could use $_POST, or > $_SESSION as you say. > > $_POST would just involve having a bunch of hidden fields that you > store the information from the earlier steps into. > > I don't think you'll be able to bake it though, probably a manual job! > > Tufty > > On Aug 21, 8:59 am, _olsen <[EMAIL PROTECTED]> wrote: >> Hello, >> >> is it possible with cake 1.2 to split a form in three views, >> >> example: >> >> http://myurl.com/addhttp://myurl.com/add2http://myurl.com/add3 >> >> I want that the last view records the stuff from the other views into >> the db, >> so I have to use session. >> >> I baked one view and the tried to splitt. but I lost the data from >> the >> two other views.. >> >> Please give me a little kick, >> >> :) >> >> Thanks, >> >> olsen > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: define('DEBUG', 0) problem
It might not be the reason. I always use relative path while referencing js, css, etc. The trouble seems to go away after I restarted my local Apache server, but I can't figure out why. On Aug 23, 3:33 pm, Alan Ford <[EMAIL PROTECTED]> wrote: > I've had a similar problem once, maybe that's it. > > It could be caused by the wrong path of the libraries/styles on the > production server. How are you including your libraries/styles in the > layout files? Are you referencing them in an absolute way or are you > using something like $javascript->link('myJavascriptFile.js')? > > With debug to zero and absolute paths, the production server will > search the files but never find them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database constraint violation using save()
http://bakery.cakephp.org/articles/view/checking-for-duplicate-records-unique-record On Aug 23, 9:39 am, Deniz Chaban <[EMAIL PROTECTED]> wrote: > Hi. I have a UNIQUE contraint on one of my fields in my database > table. > > When using save() sometimes this constraint gets violated. MySQL then > returns an exception. How do I catch this exception so that I can show > the user a good error message? > > I do not want to make a select query to see if that value is not > already in use before calling to save. > > I can't find any information about this anywhere. Maybe this is just > impossible with PHP. I'm using cake 1.2 and PHP > 4.3. > > Thanks, > Deniz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cakephp and PostgreSQL
Hi, I'm using cakephp with mysql right now, which is really simple also due to mysql "describe" function that tell cakephp how my tables look. I know that PostgreSQL lack "describe" function. So when I change my dbms to PostgreSQL will it mean that I have to specify in some cakephp configuration file how my tables are constructed? Or will cakephp use some nifty method to obtain from postgresql informations about table? If so, I'm pretty interested how is this done? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting Forbidden Error with Ajax
Hi All, I am getting some weird problem and have no clue what to do. Here is the Situation: I have added two select boxes for province and city, the city box gets populated once the user selects the province. I have referred http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/ and it works well in my local system(windows 2003 server). Now when i uploaded this application on the server, this part is not working. When i tried to debug code, in prototype.js giving alert on the server response text gives me text that "You don't have permission to access {file name} on this server. " The Path of the file is valid and opening that in browser gives the output. should i be making any changes in the configuration file while uploading the application on the server ? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: define('DEBUG', 0) problem
I've had a similar problem once, maybe that's it. It could be caused by the wrong path of the libraries/styles on the production server. How are you including your libraries/styles in the layout files? Are you referencing them in an absolute way or are you using something like $javascript->link('myJavascriptFile.js')? With debug to zero and absolute paths, the production server will search the files but never find them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Database constraint violation using save()
Hi. I have a UNIQUE contraint on one of my fields in my database table. When using save() sometimes this constraint gets violated. MySQL then returns an exception. How do I catch this exception so that I can show the user a good error message? I do not want to make a select query to see if that value is not already in use before calling to save. I can't find any information about this anywhere. Maybe this is just impossible with PHP. I'm using cake 1.2 and PHP > 4.3. Thanks, Deniz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Storing Site Preferences
On Aug 21, 2:52 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration FWIW, it doesn't seems a nice option. After taking it in our project we're scratching our heads as there doesn't seem to be a right way to access the config values in models, views and components. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Replacing data in database
Hi. Heres the problem. I have a form which returns values and stores them in a database. When a person presses submit on the form I want the ID to stay the same but the rest of the data in the table to be replaced. What it is doing at the current moment is only replacing the data that has changed. I dont want this. What i want to do is blank all fields in the table then add the new data. Heres the code and will give you a better idea of what im trying to do. Notes id is of type integer and is the primary key and set to auto_increment. $databaseData = $this->Template->query("SELECT * FROM templates WHERE sender_id = ".$sender_id); if(!empty($this->data)) { $this->data['template']['sender_id'] = $sender_id; //putting sender_id into the array if(empty($databaseData)) { $this->Template->id=null; //no template table for this sender so create 1 $this->Template->save($this->data); //save the data (this part works 100%) } else { $this->Template->del($databaseData[0]['templates']['id']); // delete that row to make it "blank/empty" $this->Template->id=$databaseData[0]['templates']['id']; //Go to that ID that was deleted $this->Template->save($this->data); // Save the data to the row with the id that was deleted } } what it does is it keeps increasing the id instead of using the old one. This happens due to auto_increment pointer . Is there any way to bypass this like delete data from the row except the id? Any help would be greatly appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Reverse routing?
Is there anyway to get reversed/mapped URLs via $html->link() or $html- >url() or so? Say, I map /foo/ to /bar/view/ But, the /bar/index page already have baked code or link to /bar/view/ . I wanted that when linked to /bar/view/, it has to show the mapped link--in this case /foo/. Is it possible? Any hint to achieve this would be highly appreciated. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: define('DEBUG', 0) problem
I also notice a problem with DEBUG = 0 today. When I turn off DEBUG, my pages (including home.ctp) renders with no layout. Just a simple message, telling me that "Sweet, [my app] is successfully baked with CakePHP" or so. Turning on DEBUG solves it immediately, the page comes back with the default layout. Did I do anything wrong here? Please give me an advice. Thanks in advanced. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: app absolute url
Stupid me - I actually checked the api but by mistake I checked version 1.1 which does not have the 'full' parameter yet. Thanks a lot for your help. Claudia On Aug 23, 8:38 am, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > On Aug 22, 8:25 pm, Claudia <[EMAIL PROTECTED]> wrote:> I am facing a similar > problem: I want to send a cake-generated email > > with some links to > > my app which need to be absolute. > > > When I use $html->url(...) I only get an url relative to my server, > > the protocol and the servername is not included. > > > >Pass the second param. Check the API declaration. > > -- > > Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---