cleanArray() Strange Behavior
Hello Everybody, When I am storing date column value(1984-04-16) in mysql data in date column field it is storing perfectly but when I use cleanArray value is displaying perfectly using setFlash() but not storing in database. Code is as bellow ** $mrClean = new Sanitize(); $mrClean-cleanArray($this-data); $this-Member-save($this-data); $this-Session-setFlash($this-data['Member']['dob']); // showing 1981-04-16 but not storing in database ** if I comment line no 2 it works perfectly. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Creating sub module / admin panel
How can we create sub module into cakephp. I want ot create an admin section for my website like www.mywebsite.com/admin/. So, how can I configure a folder named admin into my main website. --~--~-~--~~~---~--~~ 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: Creating sub module / admin panel
I want to do the same and, if is possible, adding a password to this directory admin. I searched for information to doing this feature but i haven't found nothing good. Sorry for my bad english and thanks! On May 8, 9:50 am, Jitu [EMAIL PROTECTED] wrote: How can we create sub module into cakephp. I want ot create an admin section for my website likewww.mywebsite.com/admin/. So, how can I configure a folder named admin into my main website. --~--~-~--~~~---~--~~ 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: Passing variables in URl
hi! imagine this URL http://domain/mycontroller/myaction/param1/param2 In your MycontrollerController.php you must have a myaction action, and you can read the params with something like this: function myaction($param1 = null, param2=null){ } Bye On 7 mayo, 15:54, Enchy [EMAIL PROTECTED] wrote: Hi New to this. How do you pass variables in the URL in cakephp index.php?/app/index/name/John Is this how you do it? and how do you print it in thml files ? echo $name; ? 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: Custom URLs
Hi, I try a solution for this: Routes.php include this: $Route-connect('/:language/', array('controller' = 'home', 'action' = 'index')); $Route-connect('/:language/:controller/:action/*', null,null); The first one, is to call home controller after language selection, and show the home for this language The second one is for all navigation. Using this routes you will have a param named language, and can access to it with this $this-params['language'] I hope this can help you. Bye! On 6 mayo, 01:21, pierre.k [EMAIL PROTECTED] wrote: Hi, I am looking for a solution to the following problem: basically, I want urls in form /controller/action/params as well as /en/ controller/action/params. The idea behind this is to allow for multiple languages (/en/... might as well be replaced with /cs/... and alike) and in ideal case, I would like the language identifier to be available as a global variable. This would allow me to use the variable in model (and also controller view) classes, in the following fashion, for example: class Hotel extends AppModel { var $hasOne = array(HotelTxt = array(conditions = lang={lang})); } In other words, whenever an url like /cs/* or /en/* is encountered, I need to store the cs/en part into a global var and effectively go to url * instead. Can this be achieved via cakephp routing? Or should I approach to the problem in a completely different manner? Thanks for your ideas, Petr K. --~--~-~--~~~---~--~~ 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: searching for a newsletter component
I suggest going the hosted route as well. I use a company in Australia called Vision 6. I have used a few others as well. Most companies who do this have an API that you can connect to as well, so if you want your own custom signup form you can, and have it hook into their system from your cakephp app. Cheers, Adam On May 7, 6:34 pm, gremlin [EMAIL PROTECTED] wrote: Both are capable of internationalizing your email campaigns I believe. As for european solution, I don't know of any of the top of my head. Both services are quite cheap. I think campaignmonitor is $5.00 U.S. + $0.05 U.S. for each email recipient beyond the first 5 ( they let you set up a 5 person test list for each send for free ) On May 6, 11:20 pm, jyrgen [EMAIL PROTECTED] wrote: hey abba, thanks for pointing me to this. Are these services free ? Is there anything comparable in Europe/Germany ? If this causes additional costs for my customer, i guess it's not for me. I'd rather implement my own system (or phplist) then. Regarding the load, well i heavily doubt that the community will grow far beyond 1000 Users. The mailer will of course not send 1000 emails at once. thanks, jyrgen --~--~-~--~~~---~--~~ 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 not allowing JavaScript?
I agree with Chris, this is most likely your code being wrong rather than cakephp screwing with your javascript. Check the html output from the helpers to see if it is what you would expect. Also, you don't need to use the helpers when layout out your html. I would suggest not using them until you know exactly how they work. Cheers, Adam On May 7, 11:09 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/7/07, rockit [EMAIL PROTECTED] wrote: which gives me the onclick attribute i need to trigger the image. the image swaps, but also points to a link similar as http://localhost/garydunhamequipment/img/inv/gary_dunham_ver2.gifin the browser. i just want it to swap like it did in the above example. i am wondering, is there something possibly different about the headers generated by a cake app that is causing this? I'm no Javascript guru (but I play one on TV!) but I've built a CakePHP that uses a lot of javascript and never found that Cake was doing anything that it made it harder to implement Javascript functionality. -- Chris Hartjes 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: Creating sub module / admin panel
http://cakephp.org/screencasts/view/5 On 8 май, 11:50, Jitu [EMAIL PROTECTED] wrote: How can we create sub module into cakephp. I want ot create an admin section for my website likewww.mywebsite.com/admin/. So, how can I configure a folder named admin into my main website. --~--~-~--~~~---~--~~ 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: Consuming web services in CakePHP
I am using nusoap for webservice, using the component available in Rossoft site ..Quite easy to put in place, I did make some modifications for specific purpose but the out of the box works great. On May 7, 4:29 pm, Erich C. Beyrent [EMAIL PROTECTED] wrote: I build web service clients and servers with NuSOAP - you'll need to make sure you get the latest version out of CVS. Basically, you would do something like: vendor('nusoap'); $strWSDL = 'http://www.someurl.com/path/to/wsdl'; $client = new nusoap_client($strWSDL, true); $proxy = $client-getProxy(); $proxy-call('somemethod', $args); And off you go. -Erich- Samuel DeVore wrote: no a problem in 5.x versions of php you'll be able to leverage http://us.php.net/soap in 4.x you will probably want to use something like nusoap http://dietrich.ganx4.com/nusoap/ On 5/4/07, dasiel [EMAIL PROTECTED] wrote: Hi I'm working in a project and I need to use web services but I don't know how web services are consumed in Cake, the web services are based on SOAP and they are developed in .NET I don't know if this could be a problem. Thanx a lot. Excuse me my english. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
findAll with specific fields and hasMany relation
Hi, Let's say I've got two models A and B , and the relation is A hasMany B Now I want to findAll A's with corresponding B's . this-A-findAll() works OK. I can specify fields from A this-A-findAll(null,A.ID); I've got only ID from A and a list of all B's Now I want to specify fields from B. this-A-findAll(null,B.ID); It doesn't work. It's a SQL error, becasue Cake makes : SELECT ...FROM 'a' as 'A' WHERE . and there's no such collumn : B.ID Is it possible to specify fields in hasMany relation ? --~--~-~--~~~---~--~~ 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 use an image for submit button via Ajax post
Hi, I have a simple form that I'm trying to submit via an AJAX POST. The following works for me: $ajax-submit('Submit', array('url' = 'add', 'update' ='task_todo')); BUT I want to use an image for the submit button. I don't want the native browser submit buttons to be used. Can anyone help me solve this. Thanks, Smitha --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
registration with image verification
how to validate first the do the image verification? if($this-Session-read('image_auth_string') !== $this-data['Account'] ['image_auth']){ $this-Session-setFlash('Please verify the image.'); }else{ if($this-Account-save($this-data)) { $this-Session-setFlash('The Account has been saved'); $this-redirect('/accounts/index'); } else { $this-imageAuth-generate(); $this-Session-setFlash('Please correct errors below.'); } } if i do this this will verify the image first then save, if i put it in the Account-save then it will defeat the propose of the image verification. I also cant put in in beforeSave because it uses the Session Component (is there a way to put the session component in models?) tnx in advance --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
registration with image verification
how to validate first the do the image verification? if($this-Session-read('image_auth_string') !== $this-data['Account'] ['image_auth']){ $this-Session-setFlash('Please verify the image.'); }else{ if($this-Account-save($this-data)) { $this-Session-setFlash('The Account has been saved'); $this-redirect('/accounts/index'); } else { $this-imageAuth-generate(); $this-Session-setFlash('Please correct errors below.'); } } if i do this this will verify the image first then save, if i put it in the Account-save then it will defeat the propose of the image verification. I also cant put in in beforeSave because it uses the Session Component (is there a way to put the session component in models?) tnx in advance --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Delete function dont work after specifying Database
Hi I had to specify my Database for my one app in Cake because it had uppercase letters Now all my other apps work and are exactly the same. When I want to delete something with this particular app I get a error saying that the controller is missing which is not. Has anybody had this same problem? L --~--~-~--~~~---~--~~ 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 not allowing JavaScript?
On 5/8/07, Adam Royle [EMAIL PROTECTED] wrote: I agree with Chris, this is most likely your code being wrong rather than cakephp screwing with your javascript. Check the html output from the helpers to see if it is what you would expect. Also, you don't need to use the helpers when layout out your html. I would suggest not using them until you know exactly how they work. Cheers, Adam On a related note, if you happen to use Firefox as your main browser, run (don't walk) and install FireBug. Probably the most useful Firefox extension I've ever used as part of my development practices. Essential tool for debugging Javascript problems. -- Chris Hartjes 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: problems when using Model::save() to save more than one record,
I don't know what functionality google groups offers, but can a mod do a move topic to the frequent discussions section? I know that doesn't solve that many folks don't search before asking, but I was just curious if there was more BB type functionality for the group... On May 7, 10:30 pm, Samuel DeVore [EMAIL PROTECTED] wrote: It should be noted that I am just kidding around and being silly, much too much time cooped up in the house ;) --~--~-~--~~~---~--~~ 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: registration with image verification
monmonja [EMAIL PROTECTED] wrote: how to validate first the do the image verification? Please don't use image verification (aka eye tests). http://www.w3.org/TR/turingtest Also, if using cookie-sessions for a similar test, please note on the form that cookies must be stored. Beyond that, I'm not completely sure what you're asking: I'd suggest saving the data and marking it as unverified until whatever test you use is passed. It also looks like you maybe want to redisplay the form rather than flashing. Regards, -- MJ Ray [EMAIL PROTECTED] www.ttllp.co.uk +44(0)8444 437 237 Webmaster since 1995, developer, statistician, writer, more. Registered in England and Wales, partnership number OC303457 Reg. Office: 36 Orchard Cl., Kewstoke, Somerset, GB-BS22 9XY --~--~-~--~~~---~--~~ 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: cleanArray() Strange Behavior
Look carefully at the source of generated HTML 1984-04-16 gets converted to 1984#45;04#45;16 after you do cleanArray($this-data); HTH T -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org = On 5/8/07, sanjeevdivekar [EMAIL PROTECTED] wrote: Hello Everybody, When I am storing date column value(1984-04-16) in mysql data in date column field it is storing perfectly but when I use cleanArray value is displaying perfectly using setFlash() but not storing in database. Code is as bellow ** $mrClean = new Sanitize(); $mrClean-cleanArray($this-data); $this-Member-save($this-data); $this-Session-setFlash($this-data['Member']['dob']); // showing 1981-04-16 but not storing in database ** if I comment line no 2 it works perfectly. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
phpGACL installation
Just adapting CakePHP, needing a complete auth environment and decided to use phpGACL with the plugin Mariano developed (nice work!). So far so good. Downloaded all the latest releases, put them in the right folders and started the plugin. When the page loads where it extends my database (I did not change the database.php) I can click the button to proceed with installation, it creates the tables and comes right back with the same page ... Seems like it is missing something or something did not work. Ideas anybody? :-) Using PHP5 and MySQL 5 by the way. TIA Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Arabic text in mysql
Hi, I have a database for storing company data for various print catalogues. Now we have a requirement to get Arabic information from companies as well. Hence, the company data table should now contain Arabic text along with the English. To achieve that I first converted the table from latin1 to UTF8 (utf8_general_ci). Then I changed the charcter set on my web pages containing the update forms to UTF-8. Now, the arabic data entered using the webpages is displayed fine in the resultant php pages, but when we want to see the same data in mysql (using mysql query browser/SQL yog/EMS Mysql Manager) the data shows up in binary form or . I fail to understand how can I view Arabic text as it is in a mysql query window, so that when I epxort data it comes as it is and does not come in form of special characters. Have tried searching the net but no solutions have worked so far. Kindly advise. Best regards Hitendra --~--~-~--~~~---~--~~ 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: Arabic text in mysql
On 5/8/07, shadow [EMAIL PROTECTED] wrote: Have tried searching the net but no solutions have worked so far. Definitely not a CakePHP question. C'mon people, this is not a MySQL support forum. Nor is it a PHP support forum. It's a CakePHP support forum. Don't flame me, because you know I'm right. -- Chris Hartjes 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: use $ajax-remoteFunction inside $javascript-codeBlock
I'd say, just write out a prototype AJAX request... its simple enough and you have full control over options. http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxUpdater thanks, -alan- On May 7, 9:42 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a question I have a javascript function that in my view is inside a $javascript-codeBlock. Now in this function I must use a $ajax-remoteFunction. How can I do? echo $javascript-codeBlock( function FUNCT_A (id) { !- here I create a div called div_$id ! !- here I want use $ajax-remoteFunction to update the content of div_$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 -~--~~~~--~~--~--~---
routing question: how to pass by a specific directory
hi, i have my cake app installed in the webroot dir of a server. how can configure cake's routing (or the mod_rewrite rules in the .htaccess files) so that a certain directory, also lying in root, and therefore in cake's scope, can be accessed ? i'm asking this because i want to install another app, besides the cake app, but as soon as i try to access that second app, i get missing controller errors, auth problems and such. thanks, jyrgen --~--~-~--~~~---~--~~ 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: cleanArray() Strange Behavior
hi, i m new for cake,i have created a website on my local m/c and now i want to deploy that site on my webspace,but its giving mod rewrite issue. when i m clicking on controller its not showing page in showing page not found on server error., please suggest me how can i resolve this problem.. see http://www.samruddhilifestyle.com/caketest/ and click on cue_logins controller. please help me.. thanks in advance. On 5/8/07, sanjeevdivekar [EMAIL PROTECTED] wrote: Hello Everybody, When I am storing date column value(1984-04-16) in mysql data in date column field it is storing perfectly but when I use cleanArray value is displaying perfectly using setFlash() but not storing in database. Code is as bellow ** $mrClean = new Sanitize(); $mrClean-cleanArray($this-data); $this-Member-save($this-data); $this-Session-setFlash($this-data['Member']['dob']); // showing 1981-04-16 but not storing in database ** if I comment line no 2 it works perfectly. -- Regards Shaikh Wasim +919826320559 --~--~-~--~~~---~--~~ 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: routing question: how to pass by a specific directory
Did you put the other app in the cake root, or in the webroot folder? If you put it in webroot, then you should be able to access it normally, without any config changes. so if you have this structure: cake/app/webroot/my_other_app then your app is accessible via: www.example.com/my_other_app/ On May 8, 11:01 am, jyrgen [EMAIL PROTECTED] wrote: hi, i have my cake app installed in the webroot dir of a server. how can configure cake's routing (or the mod_rewrite rules in the .htaccess files) so that a certain directory, also lying in root, and therefore in cake's scope, can be accessed ? i'm asking this because i want to install another app, besides the cake app, but as soon as i try to access that second app, i get missing controller errors, auth problems and such. thanks, jyrgen --~--~-~--~~~---~--~~ 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: cleanArray() Strange Behavior
On 5/8/07, anci wasim [EMAIL PROTECTED] wrote: hi, i m new for cake,i have created a website on my local m/c and now i want to deploy that site on my webspace,but its giving mod rewrite issue. when i m clicking on controller its not showing page in showing page not found on server error., please suggest me how can i resolve this problem.. see http://www.samruddhilifestyle.com/caketest/ and click on cue_logins controller. please help me.. thanks in advance. Help yourself by not hijacking threads. The manual clearly explains how to install CakePHP. If you don't want to take the time to read the manual (or at least confirm that you've read the manual) then don't be surprised if people don't want to help. -- Chris Hartjes 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: Arabic text in mysql
Not sure if that will help, but have you also set utf8 in your db config? var $default = array( 'driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'bla', 'login' = 'bla', 'password' = 'bla', 'database' = 'bla', 'prefix' = '', 'encoding' = 'UTF8' ); I believe this only works in 1.2. In 1.1 you need to set the encoding manually (in some before... action in the appModel). --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Fancy File Delete
Hi I have made a table called files. its for a uploader . You upload the files and details about the files get stored in database. The name of file gets stored in column name in files table The files are stored in a directory called files I would like to know what I add to this function to delete the file. Is there a built in function in cakephp for this or should I just use unlink? function delete($id) { $this-File-del($id); $this-redirect(/docs.php?PageID=$pageid); } Thanks L --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ACL check functionality in cake/scripts/acl.php
As I was exploring the use of ACL I needed a way to check the permissions of various AROs to ACOs from the command line. I modified the acl.php script in cake/scripts/ to provide this using this syntax: php cake/scripts/acl.php check aro aco A few questions: -Is this functionality already available somewhere else? -Is this functionality useful to the broader community? -And if it is, can someone point me to the directions for submitting the changes for inclusion with cakePHP? Thanks. -Brian --~--~-~--~~~---~--~~ 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: Redirect (location) from javascript
Thanks, that works wonderfully! On 4 mei, 18:45, soytuny [EMAIL PROTECTED] wrote: You can get a cake friendly URL with the $html-url function, eg window.location = '?php echo $html-url('/users/profile/')?'; On May 4, 8:32 am, Romano [EMAIL PROTECTED] wrote: Hi all, A newby question: how do I code a window.location redirect in javascript? I cannot seem to find the correct path to any of my views in the way that the $html-link helper does. Best regards, Romano --~--~-~--~~~---~--~~ 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: Fancy File Delete
Your model name File might be stepping on the toes of the File helper, but it has many of the functions you would probably want to use. http://api.cakephp.org/class_file.html The delete() function in there is what you are looking for, but check out the other functions as well as they will probably be useful for other things you are trying to do with your files. On May 8, 9:17 am, Enchy [EMAIL PROTECTED] wrote: Hi I have made a table called files. its for a uploader . You upload the files and details about the files get stored in database. The name of file gets stored in column name in files table The files are stored in a directory called files I would like to know what I add to this function to delete the file. Is there a built in function in cakephp for this or should I just use unlink? function delete($id) { $this-File-del($id); $this-redirect(/docs.php?PageID=$pageid); } Thanks L --~--~-~--~~~---~--~~ 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: Fancy File Delete
Whoops, this is actually a component, not a helper. My bad! On May 8, 10:32 am, robechar [EMAIL PROTECTED] wrote: Your model name File might be stepping on the toes of the File helper, but it has many of the functions you would probably want to use. http://api.cakephp.org/class_file.html The delete() function in there is what you are looking for, but check out the other functions as well as they will probably be useful for other things you are trying to do with your files. On May 8, 9:17 am, Enchy [EMAIL PROTECTED] wrote: Hi I have made a table called files. its for a uploader . You upload the files and details about the files get stored in database. The name of file gets stored in column name in files table The files are stored in a directory called files I would like to know what I add to this function to delete the file. Is there a built in function in cakephp for this or should I just use unlink? function delete($id) { $this-File-del($id); $this-redirect(/docs.php?PageID=$pageid); } Thanks L --~--~-~--~~~---~--~~ 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 search confusion...
Hi All, I'm hoping to get some insight on a problem I'm having. I'm fairly new to CakePHP and have read every post I can find relating to searches and pagination. (Including AD7Six's wiki entry) Basically, I have a search box on my default.thtml page. I also have a SearchController created which includes a uses statements for several tables that I'd like the user to be able to search on. Long story short...let's assume I have tables 'Cats', 'Dogs', 'Birds' and they all have an 'id', 'name' and 'description' fields. In my controller, I've been able to create an array of the search results based on another post I've seen here. ie. searchresults[0] = dog listings searchresults[1] = cat listings searchresults[3] = bird listings Is there any way possible for me to be able to display these listings with pagination? I've thought about putting the results in a tabbed output, but I don't think I can have 3 paginators on one page. Plus, it's a little confusing to navigate. So, then I thought maybe I'd just start with searchresults[0] and list the first 50 results, then move to the next 50, etc. then when they are depleted, go on to searchresults[1] and so on. I'm not sure what is possible with CakePHP. Can I set the 'data' for my SearchController to the searchresults array? Would this even work with pagination? I'm not looking for someone to hand me the code for this. I'd just like some direction or suggestions as to whether or not this is even possible. 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 -~--~~~~--~~--~--~---
adodb-access execute() error: SQL Error: Too few parameters
Hello, I am trying to use the adodb-access driver, and I have no trouble with querying, but running execute() with an UPDATE or INSERT yields an SQL error. It dumps the SQL statement to the screen, and when I run the same statement within the database, it goes without a problem. Looking at posts within the group and trac, I realise that adodb is not as well supported as the other drivers, but I feel that there would be many more posts along these lines if INSERT/UPDATE didn't work at all. Is there some kind of trick that I am missing? Thank you, phrygius --~--~-~--~~~---~--~~ 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 search confusion...
On May 8, 7:46 pm, Stacey [EMAIL PROTECTED] wrote: Hi All, I'm hoping to get some insight on a problem I'm having. I'm fairly new to CakePHP and have read every post I can find relating to searches and pagination. (Including AD7Six's wiki entry) Basically, I have a search box on my default.thtml page. I also have a SearchController created which includes a uses statements for several tables that I'd like the user to be able to search on. Long story short...let's assume I have tables 'Cats', 'Dogs', 'Birds' and they all have an 'id', 'name' and 'description' fields. In my controller, I've been able to create an array of the search results based on another post I've seen here. ie. searchresults[0] = dog listings searchresults[1] = cat listings searchresults[3] = bird listings Is there any way possible for me to be able to display these listings with pagination? I've thought about putting the results in a tabbed output, but I don't think I can have 3 paginators on one page. Plus, it's a little confusing to navigate. So, then I thought maybe I'd just start with searchresults[0] and list the first 50 results, then move to the next 50, etc. then when they are depleted, go on to searchresults[1] and so on. I'm not sure what is possible with CakePHP. Can I set the 'data' for my SearchController to the searchresults array? Would this even work with pagination? I'm not looking for someone to hand me the code for this. I'd just like some direction or suggestions as to whether or not this is even possible. Any help would be greatly appreciated. Hi Stacy, Do you really have 3 (rather similar) models named Cat, Dog and Bird? What version of cake are you using? It depends a lot on what your db looks like - but in the absence of info, you could play with the 1.1 pagination code (installable demo here http://cakeforge.org/frs/?group_id=152) Ajax/seeingDouble and PRG/ complex are the two most interesting ones given your question. hth, AD PS. the ghost of the wiki is still out there! --~--~-~--~~~---~--~~ 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 search confusion...
Hi Andy, Thanks for your reply. No, I just thought dog, cat bird would be easier =) Actually, I posted my code in your wiki article a bit ago, but I wasn't sure if anyone was keeping up with it, so I 're-posted' here after not getting any responses. I'm using Cake 1.1.x.x. I'll check out the link posted and see if I can find something that works for me. Two of the tables have identical field names, but the third is different. CREATE TABLE `conditions` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, `description` text NOT NULL, `viewed` int(5) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) CREATE TABLE `remedies` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, `description` text NOT NULL, `viewed` int(5) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) CREATE TABLE `remedies_ratings` ( `id` int(11) NOT NULL auto_increment, `user_id` int(11) NOT NULL, `remedy_id` int(11) NOT NULL, `title` varchar(64) NOT NULL, `comment` text NOT NULL, `efficacy` int(11) default '0', `tolerability` int(11) default '0', `usability` int(11) default '0', `recommendation` int(11) default '0', `helpful` int(11) default NULL, `viewed` int(11) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) Hi Stacy, Do you really have 3 (rather similar) models named Cat, Dog and Bird? What version of cake are you using? It depends a lot on what your db looks like - but in the absence of info, you could play with the 1.1 pagination code (installable demo herehttp://cakeforge.org/frs/?group_id=152) Ajax/seeingDouble and PRG/ complex are the two most interesting ones given your question. hth, AD PS. the ghost of the wiki is still out there! --~--~-~--~~~---~--~~ 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 pass an URL to PaginatorHelper::numbers()?
Hi there, when generating paging links with PaginatorHelper's prev() and next() functions I can pass an URL in this form (2nd argument, $options): $paginator-prev('Back', array('url' = array('controller' = 'photosets', 'action' = 'view', $photoset_id))); The generated URLs of the pagination links look like this: foobar.com/photosets/view/344/page:2 Works like a charm! But if I want to generate numbered links with the numbers() method of the paginator helper the passed URL is not recognized. The generated URLs in the number links look like this: foobar.com/photosets/view/url:array/page:2 In cake/libs/view/helpers/paginator.php line 253 the $url variable gets changed in a way I cannot understand fully. Maybe someone can help me with this issue. Marcus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to pass an URL to PaginatorHelper::numbers()?
Marcus T. Jaschen wrote: Works like a charm! But if I want to generate numbered links with the numbers() method of the paginator helper the passed URL is not recognized. The generated URLs in the number links look like this: foobar.com/photosets/view/url:array/page:2 In cake/libs/view/helpers/paginator.php line 253 the $url variable gets changed in a way I cannot understand fully. Maybe someone can help me with this issue. Ok, I try to help myself: Calling the numbers() method in the following way works as I want it: $paginator-numbers($photoset_id); But I think this behaviour is not intended because it conflicts with the well known way to pass URLs. M. --~--~-~--~~~---~--~~ 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: views (layouts and menus)
Thanks guys! I had thought all variables passed into view templates came in as an associative array of the parent controller name. When I accessed the variable directly it worked. My mistake. :) I'm going to play with your element ideas and see how it works for me. Thanks again, -greg 2007/5/7, soytuny [EMAIL PROTECTED]: Layouts: In which action are you setting the variable? In general, it will only be available for the view of that action. Menus: I would put the menu in an element. Or if the structure of your pages allows, put it in the layout file. (no extra data passing) HTH, Russell Austin On May 7, 1:20 pm, Greg Cerveny [EMAIL PROTECTED] wrote: Hello, I'm creating a sample cakephp app just to play with. Question 1: Layouts I want to greet the user and keep that at the top of every page (ie Hi Greg), however none of the variables I set seem to be available to my layout file. Are we able to pass more than the pagetitle into the layout files? Question 2: Menus I want to include a navigational menu for the users. Is this best included in an element or view? I noticed the elements seem to be called from directly views, with arrays passed in. Seems like a bit of extra data pushing to send information to a view, and then into an element, but on the other hand, it seems like a highly reusable component best suited for an element. --~--~-~--~~~---~--~~ 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: Downloading older versions
Typo in my original message: i need version 1.1.13 not 1.1.3. -- Robin On May 7, 4:25 pm, Robin [EMAIL PROTECTED] wrote: Hi, can anyone direct me to the source of older CakePHP versions? The Archives link on CakePHP.org under downloads is not active, and a Google search leads nowhere. Specifically, I need v.1.1.3.x to get around the problem with masterbake.php and 1.1.4. 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: Creating sub module / admin panel
Ok Hellbot but this screencasts only show how to use admin routes. This is not our problem, so we (and jitu i think so) want to make a admin dir that colect all admin routes. In fact, I'd like to protect whole dir with password HTTP (not with acl or obAuth). 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: Creating sub module / admin panel
Ok Hellbot but this screencast only shows how to use admin routes. This isn't our problem, so I want to make (and jitu too, I think) a admin dir that collects all admin routes in my application. In fact, I'd like to protect the whole dir with a password HTTP (not with acl neither obAuth). 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: Creating sub module / admin panel
I'm not sure how this fits the ideology of CakePHP :), but you can create a directory /admin inside the application webroot and then just use .htaccess .htpasswd to password-protect the admin methods. 2007/5/8, Floyd [EMAIL PROTECTED]: Ok Hellbot but this screencasts only show how to use admin routes. This is not our problem, so we (and jitu i think so) want to make a admin dir that colect all admin routes. In fact, I'd like to protect whole dir with password HTTP (not with acl or obAuth). --~--~-~--~~~---~--~~ 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 search confusion...
Andy, The Ajax 'Seeing Double' demo is pretty close to what I'm trying to accomplish. My only question, is it possible to do this with two different sets of data on the same page? Like, if I put this in my 'seeing_double.thtml': ?php echo $this-requestAction('/Pagination/Ajaxed/random?t=dogs');? ?php echo $this-requestAction('/Pagination/Ajaxed/random?t=cats');? Then, this as my random function: function random() { $random = intval(rand()); list($order,$limit,$page) = $this-Pagination- init(null,null,array('ajaxDivUpdate'='div'.$random,'url'='/ Pagination/Ajaxed/random')); if ($this-params['url']['t'] = 'dogs'){ $this-data = $this-Dogs-findAll(null, null, $order, $limit, $page); } if ($this-params['url']['t'] = 'cats'){ $this-data = $this-Cats-findAll(null, null, $order, $limit, $page); } $this-set('randomId',$random); $this-render('random'); } Would each of the two rendered paginations actually know which data it controls? On May 8, 2:41 pm, Stacey [EMAIL PROTECTED] wrote: Hi Andy, Thanks for your reply. No, I just thought dog, cat bird would be easier =) Actually, I posted my code in your wiki article a bit ago, but I wasn't sure if anyone was keeping up with it, so I 're-posted' here after not getting any responses. I'm using Cake 1.1.x.x. I'll check out the link posted and see if I can find something that works for me. Two of the tables have identical field names, but the third is different. CREATE TABLE `conditions` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, `description` text NOT NULL, `viewed` int(5) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) CREATE TABLE `remedies` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL, `description` text NOT NULL, `viewed` int(5) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) CREATE TABLE `remedies_ratings` ( `id` int(11) NOT NULL auto_increment, `user_id` int(11) NOT NULL, `remedy_id` int(11) NOT NULL, `title` varchar(64) NOT NULL, `comment` text NOT NULL, `efficacy` int(11) default '0', `tolerability` int(11) default '0', `usability` int(11) default '0', `recommendation` int(11) default '0', `helpful` int(11) default NULL, `viewed` int(11) default '0', `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`) ) Hi Stacy, Do you really have 3 (rather similar) models named Cat, Dog and Bird? What version of cake are you using? It depends a lot on what your db looks like - but in the absence of info, you could play with the 1.1 pagination code (installable demo herehttp://cakeforge.org/frs/?group_id=152) Ajax/seeingDouble and PRG/ complex are the two most interesting ones given your question. hth, AD PS. the ghost of the wiki is still out there! --~--~-~--~~~---~--~~ 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: Use of $conditions
Just wanted to point out a few things I noticed: - know your parameters: findAll($conditions=null, $fields=null, $order=null, $limit=null, $page=1, $recursive=null) - the conditions parameter for functions such as findAll is for, well, conditions (the where clause in SQL)... not sorting. Use the $order parameter for sorting. - defining the var $conditions outside the function index definition as a class property will require you to us it with this syntax: $this- conditions. I guess this is what you were aiming for: class ProgramsController extends AppController { var $name = 'Programs'; var $sort = p_date DESC, p_time ASC; var $title_for_layout = 'Lake-Sumter Computer Society'; var $helpers = array('Html', 'Form' ); function index() { $this-Program-recursive = 0; $this-set('programs', $this-Program-findAll(null, null, $this-sort)); } This link should be helpful for you on seeing function parameters: http://docs.cakephp.nu/classes/show/AppModel Good luck! Cake rocks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Elements vs requestAction
As I have been working on my app, I find myself using elements quite often. I am wondering what the advantage/disadvantage is to just using a $this-requestAction call in a view and using the normal view file associated with the action instead of creating an element. Thanks for any comments or feedback. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to pass an URL to PaginatorHelper::numbers()?
On May 8, 9:04 pm, Marcus T. Jaschen [EMAIL PROTECTED] wrote: Marcus T. Jaschen wrote: Works like a charm! But if I want to generate numbered links with the numbers() method of the paginator helper the passed URL is not recognized. The generated URLs in the number links look like this: foobar.com/photosets/view/url:array/page:2 In cake/libs/view/helpers/paginator.php line 253 the $url variable gets changed in a way I cannot understand fully. Maybe someone can help me with this issue. Ok, I try to help myself: Calling the numbers() method in the following way works as I want it: $paginator-numbers($photoset_id); But I think this behaviour is not intended because it conflicts with the well known way to pass URLs. M. Hi M. If you put the following call before using the helper: $paginator-options(array('url' = isset($this-params['pass'])?$this- params['pass']:array())); The links for the paginator helper will include whatever other parameters (but not get params) are currently in the url. 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 -~--~~~~--~~--~--~---
Associations to reduce # of queries
I'm to new using cake so file this question under 'newbies'... I have the following models: - Product (contains reference to manufacturer_id... and other information) - ProductImage (id,product_id,type [thumbnail,medium,large], image_url) - Manufacturer - Category - CategoryProduct (category_id, product_id) Each Category has many Products Each Product has 3 ProductImages (thumbnail, medium, large) - maybe could be 3 separate hasOne associations with conditions for each type Each Product has 0 or 1 Manufacturer I'd like to minimize the number of queries when viewing the products in a category. I've tried many different associations but each time cake has generated separate queries to obtain the images and manufacturers. Without cake, this can be accomplished with 1 query. It would look something like this: SELECT product.*,product_image.*,manufacturer.* FROM category_product INNER JOIN category ON category.category_id = category_product.category_id INNER JOIN product ON products.product_id = category_product.product_id INNER JOIN product_image ON product_image.product_id = product.product_id AND product_image.type = 'thumbnail' LEFT JOIN manufacturer ON manufacturer.manufacturer_id = product.manufacturer_id WHERE category_product.category_id = $id ORDER BY $sort LIMIT $start, $limit But everything I have tried in cake has resulted in 40-some queries to accomplish the same result. 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: phpGACL installation
I'm using PHP5, MySQL 5 and CakePHP 1.1.14.4797 with Mariano's phpGACL and also dAuth 0.3; no problems. The only thing I had to do was implement the connection_manager.php trunk fix to resolve a datasource error message. That doesn't sound like your issue, though... On May 8, 9:45 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Just adapting CakePHP, needing a complete auth environment and decided to use phpGACL with the plugin Mariano developed (nice work!). So far so good. Downloaded all the latest releases, put them in the right folders and started the plugin. When the page loads where it extends my database (I did not change the database.php) I can click the button to proceed with installation, it creates the tables and comes right back with the same page ... Seems like it is missing something or something did not work. Ideas anybody? :-) Using PHP5 and MySQL 5 by the way. TIA Paul --~--~-~--~~~---~--~~ 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: Creating sub module / admin panel
Jitu and Floyd, you can create a controller named Admin, with just one method named index. This controller without any models (using var $uses = array()) So in the index view of Admin controller you will add your painel menu. To verify when the user is acessing a admin method (by admin route) (like /admin/posts/add) in AppController you can check if is admin route and if it is true you check if the user is logged. Like this: ? class AppController extends Controller { function beforeFilter() { if (isset($this-params[admin])) { // if you are acessing any method defined as admin $this-checkSession(); } } function checkSession(){ // checks if user has been logged if not redirect to login page } } ? []'s Tulio Faria www.tuliofaria.net On 8 maio, 16:53, Hellbot [EMAIL PROTECTED] wrote: I'm not sure how this fits the ideology of CakePHP :), but you can create a directory /admin inside the application webroot and then just use .htaccess .htpasswd to password-protect the admin methods. 2007/5/8, Floyd [EMAIL PROTECTED]: Ok Hellbot but this screencasts only show how to use admin routes. This is not our problem, so we (and jitu i think so) want to make a admin dir that colect all admin routes. In fact, I'd like to protect whole dir with password HTTP (not with acl or obAuth). --~--~-~--~~~---~--~~ 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: Creating sub module / admin panel
I forgot one thing. You need to redirect the /admin/ to admin- index in routes, using: $Route-connect('/admin', array('controller' = 'admin', 'action' = 'index')); []'s Tulio Faria www.tuliofaria.net On 8 maio, 19:47, Tulio Faria [EMAIL PROTECTED] wrote: Jitu and Floyd, you can create a controller named Admin, with just one method named index. This controller without any models (using var $uses = array()) So in the index view of Admin controller you will add your painel menu. To verify when the user is acessing a admin method (by admin route) (like /admin/posts/add) in AppController you can check if is admin route and if it is true you check if the user is logged. Like this: ? class AppController extends Controller { function beforeFilter() { if (isset($this-params[admin])) { // if you are acessing any method defined as admin $this-checkSession(); } } function checkSession(){ // checks if user has been logged if not redirect to login page} } ? []'s Tulio Fariawww.tuliofaria.net On 8 maio, 16:53, Hellbot [EMAIL PROTECTED] wrote: I'm not sure how this fits the ideology of CakePHP :), but you can create a directory /admin inside the application webroot and then just use .htaccess .htpasswd to password-protect the admin methods. 2007/5/8, Floyd [EMAIL PROTECTED]: Ok Hellbot but this screencasts only show how to use admin routes. This is not our problem, so we (and jitu i think so) want to make a admin dir that colect all admin routes. In fact, I'd like to protect whole dir with password HTTP (not with acl or obAuth). --~--~-~--~~~---~--~~ 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 styles with ajax-link
I have a site that I'm migrating to cakephp. I've successfully used ajax-link for all async, non-stylized links, but I have a number of links that require various css classes for their proper layout. I've almost spent the past day reading posts and the helper document, but no luck. Can someone point me in the direction of some prose to help allow me to continue to stylize my ajax links? 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: Using styles with ajax-link
If I'm understanding your question you can use $ajax-link('User Profile', '/users/profile/', array('class'='stylemyajax')) or $ajax-link('User Profile', '/users/profile/', array('style'='border: 8px dotted green')) On May 8, 4:49 pm, BigBee [EMAIL PROTECTED] wrote: I have a site that I'm migrating to cakephp. I've successfully used ajax-link for all async, non-stylized links, but I have a number of links that require various css classes for their proper layout. I've almost spent the past day reading posts and the helper document, but no luck. Can someone point me in the direction of some prose to help allow me to continue to stylize my ajax links? 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 -~--~~~~--~~--~--~---
cake 1.2 check boxes
I'm using 1.2 the lastest alpha(not from SVN) Which class should I use to create a checkbox that can be validated by the model? I'm also using the validation class in 1.2 what is the best method to validate it? I'm currently using the following to generate the check box in the view: $form-input('Application/terms_conditions', array('type'='checkbox', 'label'='I have read, understand and agree to Artspan\'s a href=#Terms and Conditions/a')) This renders the check box okay, but I'm having trouble validating that the user must check it before the can save successfully I would greatly appreciate any insight. --~--~-~--~~~---~--~~ 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 pagination PRG
Hello I try to do a search over a pagination component i found this http://www.noswad.me.uk/Pagination/PRG but i can't download the source any one have this source or some like that ?? thz stefano s. --~--~-~--~~~---~--~~ 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: Elements vs requestAction
I believe from what I've read, that a big reason for not using a series of requestActions is performance. Run a series of requestAction calls and check the speed. Cake Processing Explained: http://groups.google.ca/group/cake-php/browse_thread/thread/7cf805d7ae1841ab/39c1ed08657b19c1%2339c1ed08657b19c1 More info: http://www.thinkingphp.org/category/spliceit/ http://www.soledadpenades.com/2006/11/13/beware-of-cakephps-requestaction/ http://www.mail-archive.com/cake-php@googlegroups.com/msg03717.html On May 8, 5:49 pm, buzznut [EMAIL PROTECTED] wrote: As I have been working on my app, I find myself using elements quite often. I am wondering what the advantage/disadvantage is to just using a $this-requestAction call in a view and using the normal view file associated with the action instead of creating an element. Thanks for any comments or feedback. --~--~-~--~~~---~--~~ 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: Associations to reduce # of queries
I don't think you will have much luck getting cake to produce a similar query. But an easy solution is to wrap your query inside a function in your Product model. Say function getCategoryProducts($categoryId) { return $this-query(/*that query you've written*/); } Then you can use that in your controllers: $catProds = $this-Product-getCategoryProducts($categoryId); Just be sure to use table aliases like FROM products AS Product to make the array nicer. Russell Austin On May 8, 3:04 pm, johnvv [EMAIL PROTECTED] wrote: I'm to new using cake so file this question under 'newbies'... I have the following models: - Product (contains reference to manufacturer_id... and other information) - ProductImage (id,product_id,type [thumbnail,medium,large], image_url) - Manufacturer - Category - CategoryProduct (category_id, product_id) Each Category has many Products Each Product has 3 ProductImages (thumbnail, medium, large) - maybe could be 3 separate hasOne associations with conditions for each type Each Product has 0 or 1 Manufacturer I'd like to minimize the number of queries when viewing the products in a category. I've tried many different associations but each time cake has generated separate queries to obtain the images and manufacturers. Without cake, this can be accomplished with 1 query. It would look something like this: SELECT product.*,product_image.*,manufacturer.* FROM category_product INNER JOIN category ON category.category_id = category_product.category_id INNER JOIN product ON products.product_id = category_product.product_id INNER JOIN product_image ON product_image.product_id = product.product_id AND product_image.type = 'thumbnail' LEFT JOIN manufacturer ON manufacturer.manufacturer_id = product.manufacturer_id WHERE category_product.category_id = $id ORDER BY $sort LIMIT $start, $limit But everything I have tried in cake has resulted in 40-some queries to accomplish the same result. 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: cake 1.2 check boxes
In 1.2 Model/field notation is deprecated in favor of Model.field. So what you have in the view should be: ?php echo $form-input('Application.terms_conditions', array( 'type'='checkbox', 'label'='I have read, understand and agree to Artspan\'s a href=#Terms and Conditions/a', 'error' = 'You must agree to our Terms and Conditions' )); ? Then on your Application model you should have this validation defined at least: var $validate = array( 'terms_conditions' = '/1/' ); -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de roliver Enviado el: Martes, 08 de Mayo de 2007 10:34 p.m. Para: Cake PHP CC: [EMAIL PROTECTED] Asunto: cake 1.2 check boxes I'm using 1.2 the lastest alpha(not from SVN) Which class should I use to create a checkbox that can be validated by the model? I'm also using the validation class in 1.2 what is the best method to validate 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 -~--~~~~--~~--~--~---
site conversion
hi all, i developed this website www.istats.com.au which is an online portal for fitness and health. i have recently commissioned work to allow me to work on it to add extra features and make it more reliable. do you think its worthwhile converting the whole codebase to cakephp? how long would you expect it to take?? any thoughts / suggestions on the process or how I would go about it would be appreciated. i have had attempts on doing so but have been hitting walls in figuring out cake works :'( thanks, craig --~--~-~--~~~---~--~~ 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: site conversion
Hi craig I have found that work that I do in Cake is easy to maintain and extend. Much more so than projects that I have done with things like Drupal and OSCommerce. I expect that you will find it hard work to do the conversion initially as Cake (the MVC design patern really) tends to shape the functionality to some degree (in my opinion). However, I would probably start by implementing one small section to help you get a feel for how Cake works. Ultimately if you convert the code, then you will reap rewards in maintenance and expansion down the track. But I would expect it to be non-trivial to convert the site as it stands (but don't let that stop you!). Regards, Langdon laptop wrote: hi all, i developed this website www.istats.com.au which is an online portal for fitness and health. i have recently commissioned work to allow me to work on it to add extra features and make it more reliable. do you think its worthwhile converting the whole codebase to cakephp? how long would you expect it to take?? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---