Re: Duvidas sobre associações no cake
Descobri o problema tudo se resolveu alterando os relacionamentos. class Empresa extends AppModel { var $name = Empresa;//PHP4 var $hasMany = array(Contato); } class Contato extends AppModel { var $name = Contato;//PHP4 var $belongsTo = array(Empresa,Funcaocontato); } class Funcaocontato extends AppModel { var $name = Funcaocontato;//PHP4 var $hasMany = array(Contato); } e claro, aproveitei a dica do Tulio para colocar o recursive=2; Abraço a todos Rodrigo Guimarães On 7/5/07, Rodrigo Xavier [EMAIL PROTECTED] wrote: On 7/5/07, Rodrigo Xavier [EMAIL PROTECTED] wrote: Não entendi tambem o motivo do recursive = 2, a menos que fosse para ter uma empresa que possuice outras agregadas (no caso de uma empresa matriz e suas filiais). Correto? Acabei de ler; Quando o recursive esta setado como 1 ele retorna todos os modelos associados ... ou deveria retornar Rodrigo -- Rodrigo Guimarães Desenvolvedor Web --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português dos Grupos do Google. Para enviar mensagens para este grupo, envie um email para cake-php-pt@googlegroups.com Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED] Para mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-PT -~--~~~~--~~--~--~---
Re: URL Rewriting
On Jul 5, 4:41 am, Feris Thia [EMAIL PROTECTED] wrote: Hi All, I'm a newbie to cakephp, and have learnt that cake's URL with .htaccess looks like this : http://myhost/controllername/action/param1 can we modified it to http://myhost/param1/controllername/action Thanks, Feris Routes. http://manual.cakephp.org/chapter/configuration --~--~-~--~~~---~--~~ 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: New CakePHP Application Launches
Did you add it to http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild And maybe consider a Case Study for the Bakery. We are always looking for good real-world examples of applications built on Cake. The site looks very nice as well. Geoff -- http://lemoncake.wordpress.com On Jul 5, 3:00 pm, oms [EMAIL PROTECTED] wrote: Thanks! It really needs some content right now, so would be great if bakers from all over would contribute some articles! :) Omar On Jul 4, 7:24 pm, Jonathan Langevin [EMAIL PROTECTED] wrote: just upon first glance, awesome looking site, gj! On 7/4/07, oms [EMAIL PROTECTED] wrote: Hi all, We've just launchedwww.trippert.com-a travel community site built using cakePHP. Please help us out by checking it out, giving us feedback, and writing a few articles about your travels (or where you live!). :) Thanks, Omar --~--~-~--~~~---~--~~ 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: New CakePHP Application Launches
+1 on how nice the site looks, and seems fast. A good case study could be the search you have going on there. I've done some code to incorporate FULLTEXT searching (need to convert it to a behavior) which works very well, but still need some polishing before I publish it. -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 Geoff Ford Enviado el: Jueves, 05 de Julio de 2007 03:36 a.m. Para: Cake PHP Asunto: Re: New CakePHP Application Launches And maybe consider a Case Study for the Bakery. We are always looking for good real-world examples of applications built on Cake. The site looks very nice as well. --~--~-~--~~~---~--~~ 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: New CakePHP Application Launches
Nice! Well done! Is it based on Cake 1.2? Did you use the auth component? Good job mate! Dan --~--~-~--~~~---~--~~ 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: Flay and Other Markup Translation Tools
Thanks Geoff I had considered bbcode but (apparently) our target audience would be more familiar with a wiki-style markup (thanks Wikipedia:) The bakery helper is certainly good to know about tho'. ~GreyCells On Jul 5, 12:25 am, Geoff Ford [EMAIL PROTECTED] wrote: BBCode is a well known alternative, this is from a recent thread quote Here is the Bakery's implementation as a helper :-https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/bakery/views/h... Basically in the view you call $bbcode-format($this-data['ModelName'] ['bbcode']); /quote Geoff --http://lemoncake.wordpress.com On Jul 5, 3:42 am, GreyCells [EMAIL PROTECTED] wrote: I'm investigating 'markup translation tools' to allow untrusted users to create content -Flayseems an obvious choice, but I cannot seem to find any documentation on it - just four article in this group, one of which casts doubt on it's longevity. http://groups.google.com/group/cake-php/browse_thread/thread/2c8d5d9c... I haven't yet found the trac reference at the end of that thread. If it's around for the long haul, I'd like to get my hands on some docs and put together an article for the bakery. Textile is another obvious choice, but by default allows raw html (and my implementation/fix for that feels like a bit of a kludge). So... any recommendations for implementing a clean cake-ish solution for allowing untrusted users to enter content? Many thanks ~GreyCells --~--~-~--~~~---~--~~ 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: New CakePHP Application Launches
oms [EMAIL PROTECTED] wrote: We've just launched www.trippert.com - a travel community site built using cakePHP. Please help us out by checking it out, giving us feedback [...] How do you expect people to give feedback? The feedback link in the top bar does nothing and the contact link at the bottom says This page will contain contact information. My feedback was that some of the alt tags seem silly (Logo should be replaced by Trippert for example) and some of the colour choices make the site confusing for browsers which don't load images or use javascript (failing to ensure sufficient contrast, for example). With images but without Javascript, main pictures never load - you'd only ever see the throbber. The pages don't scale down to 512px width (for people using 1x2 or 2x2 tiled browsers on 1024px screens) and stuff just gets cut off the right-hand-side with no horizontal scroll bar in Firefox 1. All of these should be fixed and usually can be fixed quite easily on a CakePHP site - there's no need to be inaccessible. That said, the site idea and general implementation seems pretty cool, like a much easier-to-use TripAdvisor. It could go a lot of places and I can see how you could make money from it. One obvious user-aimed improvement idea is to add meta ICBM to each location page and submit them to geoURL and similar sites. Regards, -- MJ Ray [EMAIL PROTECTED] www.ttllp.co.uk +44(0)844 4437 237 Webmaster since 1994, programmer, statistician, writer, more. Turo Technology LLP, reg'd in England+Wales, 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: admin backend best practice
Cheers guys! Well 1 thing I did not thougt about before is that eventually I can change the layout of the actioin reserved to admins, in order to dress up the admin area differently! i.e $this-layout = 'default'; //in normal actions $this-layout = 'admin'; //in admin actions ...but I should learn how to use the ACL component a bit more. In particular I was investigating about this in the past:Setting ACL dinamically 1.2 http://groups.google.com/group/cake-php/browse_frm/thread/179d31ff00fc99ca/d246e486bccfd2cf#d246e486bccfd2cf ...and maybe I should also read the Getting Real book ;o) On 5 Lug, 03:34, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/4/07, citrus [EMAIL PROTECTED] wrote: I also prefer approach #1. Actually I use it in all of my mini projects. You know, I was just thinking that not only is #1 a good approach (build the admin stuff right into the app) but by putting ACL stuff in there you can also give some of your more trusted users access to beta features when you want to try out some new functionality. A lot of this stuff I've cribbed from the book Getting Real produced by the folks at 37 Signals. Yes, I know they are the people behind Ruby on Rails but they stay technology-neutral in that book. -- 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: admin backend best practice
I also use a single app for both front and backend. When the user logs in with an account flagged as having admin privileges, I show an admin link in the page footer. Non-admin users never see that link. Clicking the admin link brings up the admin panel, which sets a different layout. All actions invoked from the admin layout are preceded by admin_. In my appController, I have a check to determine if the requested action is prefixed by admin_, and if so redirect anyone who is not logged in as admin to the login page. Is this how other people who use a single app do 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: session does not expire
Change your CAKE_SECURITY to high. On Jul 4, 9:02 pm, SMARTEGURU [EMAIL PROTECTED] wrote: Hi, my session doesn't expire even in IE when new browser opened i have following setting i am using cake1.2 with following setting in core.php define('CAKE_SESSION_SAVE', 'database'); define('CAKE_SECURITY','low'); define('CAKE_SESSION_TIMEOUT', '12'); Please help Thank --~--~-~--~~~---~--~~ 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 use html character code in title for paginationHelper
Oh, never mind, I got the answer at http://groups.google.com/group/cake-php/browse_thread/thread/41f783aaf82a8ffb/5076b3bfbd3aaf9b?lnk=gstq=characters+helpersrnum=2#5076b3bfbd3aaf9b On Jul 4, 2:56 pm, Thomas [EMAIL PROTECTED] wrote: Hello, I'm using cake 1.2 and implemented pagination. It works like a charm and was very (!) easy to implement. There is only one very small thing I can't solve. The default title for the prev and next functions ($paginator-next() and $paginator-prev()) is Prev and Next . I want to change this to Dutch and use the character laquo; and raquo;. The translating is no problem, but the special characters are. To change the default title I use $paginator-next($title = laquo; Volgende). The problem is that cake translates the laquo; to amp;laquo;. Does anybody know how to solve this without tweaking the source? 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: HABTM findAll problem
O'Brothers! It worked, thank you all. --~--~-~--~~~---~--~~ 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: URL Rewriting
Ah ... I see. Thanks AD7Six. Btw, one more question what is :action anyway ? Feris On 7/5/07, AD7six [EMAIL PROTECTED] wrote: On Jul 5, 4:41 am, Feris Thia [EMAIL PROTECTED] wrote: Hi All, I'm a newbie to cakephp, and have learnt that cake's URL with .htaccess looks like this : http://myhost/controllername/action/param1 can we modified it to http://myhost/param1/controllername/action Thanks, Feris Routes. http://manual.cakephp.org/chapter/configuration --~--~-~--~~~---~--~~ 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 cache all the view in call ?
the question was not how to use cache but how to generate de cached contente for every action of my site every morning, so that the first people how use the site can take benefits of the cached view. On 1 juil, 18:49, Samuel DeVore [EMAIL PROTECTED] wrote: gwoo: it'shttp://manual.cakephp.org/chapter/view_cacheI think On 7/1/07, gwoo [EMAIL PROTECTED] wrote: http://manual.cakephp.org/chapters/caching -- (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: webroot getting appended in subsequent links?
On Jul 4, 8:58 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm curious about this too, Rajesh. It actually causes my sessions to expire when the webroot link is appended. Has anyone fixed this before? snip Problem is with the dispatcher.php baseUrl() function line# 515 (svn rev 5334) https://trac.cakephp.org/browser/branches/1.2.x.x/cake/ dispatcher.php#L515 On this line, for me: $webrootDirName = 'webroot'; $scriptName = '/webroot/index.php'; so, $regs = Array([0] = /webroot, [1] = , [2] = ) It's not clear what they want to acheive with this regexp, but they're returning the full match ($base.$r[0];); I changed it to ($base.$r[1];)--now seems to be ok. I suppose, anyone who is deploying projects under /public_html/ should get this issue. -- ?php echo 'Just another PHP saint'; ? 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 -~--~~~~--~~--~--~---
Foreign keys
Hello, when I try to insert a new record in a certain table I get the error Cannot add or update a child row: a foreign key constraint fails The table has three foreign keys and six other fields, but this error appairs with every record I try to insert in the table, even if I don't give any values to the foreign keys. What can be the 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: Two pagination on single page
If you use one url submitting then it will refresh the whole page and you will lose the options for the ajax pagination. You could pass in the paramters in with named args. You'd need to make sure they are different names for each paginator. On Jul 3, 11:17 am, lalit kumar [EMAIL PROTECTED] wrote: thanks dear, can u tell me is there any possibility's to use one ajax paging and another one is url submiting page?. little bit confuse. On 7/3/07, Spectacularium [EMAIL PROTECTED] wrote: Use the ajax pagination to fix this problem or else you can use custom params in the url for populating the paginator. On Jul 3, 6:16 am, lalit kumar [EMAIL PROTECTED] wrote: hi, can u help me. i wanna to configure two pagination on single page in cake php. the problem is that all the varibles of second pagination orverwrite the first one pagination. Thanks lalit Lalit Kumar Software Engg. Netsolutions Chandigarh 09888711687 -- Lalit Kumar Software Engg. Netsolutions Chandigarh 09888711687 --~--~-~--~~~---~--~~ 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 1.2 + Auth component (Auth::validate)
Hi, I'm trying to use new Auth component. I've got problem with Auth::validate. I want to use my own validation, not 'actions' or 'objects'. So, as it stands in the comment, in beforeFilter() of my appController I do: $this - Auth - validate = null; However, it doesn't work (maybe I'm wrong?) - the validation occurs and Auth component redirects me to /users/login. When I do $this - Auth - allow('*'); everything is ok. I want to build users system with several groups, that's why I'm not using 'action' type validation (is this good way of doing 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: Cache Elements for Different Users
On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any scope in an enhancement to the Cake cache, that allowed you to bind certain session variables into the cache hash. Eg. you could setup the cache for certain views to be cached with an md5 of specified session variables. I suggest you go to trac.cakephp.org and submit the enhancement request. No guarantees it will be accepted, but you never know. -- 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: CakePHP 1.2 + Auth component (Auth::validate)
I've tried already, anything changes... On 5 Lip, 14:59, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/5/07, Pillow [EMAIL PROTECTED] wrote: Try $this-Auth-validate = false --~--~-~--~~~---~--~~ 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: Cache Elements for Different Users
Thought it could do with some discussion before going onto trac, so we could clean up any debate over it, but yeah, will get round to that soon. simon On Jul 5, 2:15 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any scope in an enhancement to the Cake cache, that allowed you to bind certain session variables into the cache hash. Eg. you could setup the cache for certain views to be cached with an md5 of specified session variables. I suggest you go to trac.cakephp.org and submit the enhancement request. No guarantees it will be accepted, but you never know. -- 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: Cache Elements for Different Users
On 7/5/07, Ketan Patel [EMAIL PROTECTED] wrote: Can some one pls shed some light here. I don't think Cake can help you out there. What you might have to do is code your element in such a way that it does the caching itself based on a unique ID. You might consider a small file-based caching system. Not easy, but what you're asking for isn't easy. -- 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: CakePHP 1.2 + Auth component (Auth::validate)
On 7/5/07, Pillow [EMAIL PROTECTED] wrote: Hi, I'm trying to use new Auth component. I've got problem with Auth::validate. I want to use my own validation, not 'actions' or 'objects'. So, as it stands in the comment, in beforeFilter() of my appController I do: $this - Auth - validate = null; However, it doesn't work (maybe I'm wrong?) - the validation occurs and Auth component redirects me to /users/login. When I do $this - Auth - allow('*'); everything is ok. Try $this-Auth-validate = false -- 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: Cache Elements for Different Users
Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php $this-requestAction('controller'='tag', 'action'='generateTagCloud'); ? What I would want to do is to have a cached element individual to each user? So it could be like 'tagCloud_user1', 'tagCloud_user2',... so on. but I could n't find anything in the code that really does that? Can some one pls shed some light here. Thanks, Ketan Patel wrote: Is there a way to cache elements separately for each user? Currently, since the element name is same, the cache is basically overwritten, I would prefer to cache the element individually. So that later on, I can delete the cache when an update is performed for that user, otherwise it is uses the cached view. 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: Models in default.thtml
Ah, okay. That's what I was aiming at. I'm porting a Rails app to Cake and wasn't sure if I could use that line in the view. I probably should have stated where that line of code was. Thank you very much, though, for your answer. On Jul 4, 1:36 am, francky06l [EMAIL PROTECTED] wrote: I am a bit confused with the model in default.thtml and the question. Models are not available in views, you would need the controller to access your model and pass the data to the view. On Jul 3, 6:58 pm, Brian [EMAIL PROTECTED] wrote: I feel like this is a very small thing I'm missing, but I haven't yet found a solution. So my problem is that I want to have a dynamic menu displayed on every page, based on visible instances of one of my models. However, when I try to do something like this: ?php foreach($this-Menu-findAll(null, null, $order = root DESC) as $menu): ? I get the call to a member function on a non-object error. I've told my AppController that it's supposed to use the Menu model (var $uses...) but that's not working. Any advice? Thanks much again. --~--~-~--~~~---~--~~ 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: Cache Elements for Different Users
Is there any scope in an enhancement to the Cake cache, that allowed you to bind certain session variables into the cache hash. Eg. you could setup the cache for certain views to be cached with an md5 of specified session variables. It would solve this problem, and probably make quite a nice feature for other sites and applications as well. Just an idea. Simon On Jul 5, 2:08 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/5/07, Ketan Patel [EMAIL PROTECTED] wrote: Can some one pls shed some light here. I don't think Cake can help you out there. What you might have to do is code your element in such a way that it does the caching itself based on a unique ID. You might consider a small file-based caching system. Not easy, but what you're asking for isn't easy. -- 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: admin backend best practice
Well, this is also a way to do it. However, you technically doing twice the work in this approach too. Rather than having separate 'admin_' actions and regular actions, put the admin activities with in the regular functions. Let me clarify what I mean by this. Say you have PostsController which is class PostsController extends AppController{ var $name = 'Posts'; function edit() { // Do the ACL Access check here, check if it is // user who is allowed to edit or it is the Admin here // otherwise redirect to other page } // no need of having separate admin_edit() as you are // taking care of admin actions in edit itself. } in your view for posts_edit action. if ($isAdmin) { // Show admin action urls, otherwise don't show it. } By following above strategy, you would not have to have two separate actions in Controller and two separate views. In just one view and one action, you have both admin as well as regular user functionality. And of course, using ACL, will obviously give more finer control. Cheers, Ketan keymaster wrote: I also use a single app for both front and backend. When the user logs in with an account flagged as having admin privileges, I show an admin link in the page footer. Non-admin users never see that link. Clicking the admin link brings up the admin panel, which sets a different layout. All actions invoked from the admin layout are preceded by admin_. In my appController, I have a check to determine if the requested action is prefixed by admin_, and if so redirect anyone who is not logged in as admin to the login page. Is this how other people who use a single app do 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: CakePHP 1.2 + Auth component (Auth::validate)
Dunno if this can help, but I managed as explained in the following post: = http://groups.google.com/group/cake-php/t/871ff4c536bc1e00 Dan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Calling Cake script from console
Hey, I need to call one of controller's actions from console, what would be the best way to do it? I am using Cake 1.1 Thanks -- Sincerely yours, Olexandr Melnyk http://omelnyk.net/ --~--~-~--~~~---~--~~ 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: Cache Elements for Different Users
On Jul 5, 6:03 pm, Ketan Patel [EMAIL PROTECTED] wrote: Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php $this-requestAction('controller'='tag', 'action'='generateTagCloud'); ? What I would want to do is to have a cached element individual to each user? So it could be like 'tagCloud_user1', 'tagCloud_user2',... so on. but I could n't find anything in the code that really does that? snip What about passing params? $this-element('tagCloud', array('cache'='+1 day', 'user_id'=10) -- ?php echo 'Just another PHP saint'; ? 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 -~--~~~~--~~--~--~---
html emails: $this-render() with external style sheets
I have message text for an html email in a view called 'order_email', and a corresponding layout called 'email'. I use: ob_start(); $this-controller-render('order_email','email'); $mail = ob_get_clean(); return $mail; The $mail variable now contains the rendered html, which I can include in the email. The problem is: When the user receives the email, although all inline css styling is applied to the html, none of the styles from the @imported external stylesheets are applied. Short of hardocing the contents of the external css stylesheet into the layout, is there anyway to keep the stylesheet external, yet have the user see the html with the styles applied? Is there anyway to get $this-render() to inset in the contents of the external CSS file in place of the @import link to 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 -~--~~~~--~~--~--~---
Select which populate another select
Hello ! I have a select tag in a view and I would like to populate a second select tag in the same view with the id selected of the first select tag . It means for example, a select tag with id and province name, and i would like to populate a second select tag with id and town name with the id of province selected before. How can I 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: Foreign keys
Giulio Simeone wrote: Hello, when I try to insert a new record in a certain table I get the error Cannot add or update a child row: a foreign key constraint fails The table has three foreign keys and six other fields, but this error appairs with every record I try to insert in the table, even if I don't give any values to the foreign keys. What can be the problem? The problem is the foreignKeys. You do not have the foreignKey constraint satisfied and that's why MySql is complaining. ForeignKeys means that for that value, you have the entry in the foreign Table. If you have table Posts in which you define category_id as the foreign key then, the value of category_id must be present in id field of category table. Cheers, 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 -~--~~~~--~~--~--~---
Re: Select which populate another select
*On Thu, Jul 05, 2007 at 07:36:06AM -0700 ricarou51 [EMAIL PROTECTED] wrote: From: ricarou51 [EMAIL PROTECTED] To: Cake PHP cake-php@googlegroups.com Subject: Select which populate another select Date: Thu, 05 Jul 2007 07:36:06 -0700 Hello ! I have a select tag in a view and I would like to populate a second select tag in the same view with the id selected of the first select tag . It means for example, a select tag with id and province name, and i would like to populate a second select tag with id and town name with the id of province selected before. How can I do this ? I'm not expert, but the most common method would be to use some javascript (AJAX), watch the event for the first select, then populate the second. OTOH, post/get could work too. Thanks -- Jon Molesa [EMAIL PROTECTED] if you're bored or curious http://rjmolesa.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: webroot getting appended in subsequent links?
I was using symlinks actually. This worked Tarique. Thanks! Wilson On Jul 5, 6:53 am, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Jul 5, 10:49 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote: Are you using symlinks by any chance? If yes then point the symlink to the app folder rather than the outside folder - this had solved the problem for me snip Thanks for the point. I'm not using symlinks. The problem seems to be with dispatcher.php baseUrl() function line# 515 (svn rev 5334) https://trac.cakephp.org/browser/branches/1.2.x.x/cake/ dispatcher.php#L515 I think, I got that fixed. Thanks anyway. -- ?php echo 'Just another PHP saint'; ? 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: 1.2 Pagination SQL Injection
On 7/5/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: The read() method handles it. But, if you have any link or resource for handling situation like search form, that will be very helpful. I think Larry already said that if you follow the conventions, it will take care of sanitizing things. What is so different about a search form that you think CakePHP's internal methods will not handle it? Again, follow the conventions and CakePHP will take care of the rest? I'm curious to read your explanation. -- 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: webroot getting appended in subsequent links?
On 7/5/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: I'm not surprised... well, I have posted my environment, my variables and my doubts. If you can let me know the reason for regexp, or if you have installed in similar setup and how, that will be helpful. I have my layout as follows: cake is in ~/src/cake app is in ~/src/app name here I have multiple apps running off of the same CakePHP core Now, I use Apache2 so here's a sample entry in my vhosts: ServerName local.cakedevelopment DocumentRoot /home/chartjes/src/cakedevelopment/webroot Directory /home/chartjes/src/cakedevelopment/cake/webroot Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all /Directory Now, in my app/webroot/index.php all I've done is the following: if (!defined('CAKE_CORE_INCLUDE_PATH')) { //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR'); //You should also use the DS define to separate your directories define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cake'); } That's it. My apps work just fine, no need to hack dispatcher or any other part of Cake to get it to work. I say this all the time: CakePHP has a set of rules and if you don't follow them, you shouldn't be surprised when things don't work. -- 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: webroot getting appended in subsequent links?
It's not clear what they want to acheive with this regexp, but they're returning the full match ($base.$r[0];); I changed it to ($base.$r[1];)--now seems to be ok. *sigh* Why is that people think they must hack simple things like the dispatcher to get something to work? Are you using one of the standard layouts from the CakePHP manual or are you moving things around? Changing where CakePHP is expecting things to be leads to silly things like changing the dispatcher. Honestly, I've never had to touch anything in the core to get my apps to work. The culprit is usually incorrect settings in webroot/index.php or a bad rewrite rule in .htaccess. I know people like to think they find errors in the core of an application when their stuff won't work, but please PLEASE read the manual's section on configuration so you UNDERSTAND what CakePHP is expecting. -- 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: how to cache all the view in call ?
Well, one way to do it, could be based on the timestamp. In controller, you look at the cache's file timestamp and then compare it with time(), if the day is same as today, then do nothing, otherwise clearCache() the view. So, for the first user visiting your site next day, automatically controller will take care of deleting previous day's cache and create a new one instead. Cheers, Ketan ;-) wluigi wrote: the question was not how to use cache but how to generate de cached contente for every action of my site every morning, so that the first people how use the site can take benefits of the cached view. On 1 juil, 18:49, Samuel DeVore [EMAIL PROTECTED] wrote: gwoo: it'shttp://manual.cakephp.org/chapter/view_cacheI think On 7/1/07, gwoo [EMAIL PROTECTED] wrote: http://manual.cakephp.org/chapters/caching -- (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: webroot getting appended in subsequent links?
On Jul 5, 8:01 pm, Chris Hartjes [EMAIL PROTECTED] wrote: It's not clear what they want to acheive with this regexp, but they're returning the full match ($base.$r[0];); I changed it to ($base.$r[1];)--now seems to be ok. *sigh* Why is that people think they must hack simple things like the dispatcher to get something to work? Are you using one of the standard layouts from the CakePHP manual or are you moving things around? Changing where CakePHP is expecting things to be leads to silly things like changing the dispatcher. Honestly, I've never had to touch anything in the core to get my apps to work. The culprit is usually incorrect settings in webroot/index.php or a bad rewrite rule in .htaccess. I know people like to think they find errors in the core of an application when their stuff won't work, but please PLEASE read the manual's section on configuration so you UNDERSTAND what CakePHP is expecting. snip I'm not surprised... well, I have posted my environment, my variables and my doubts. If you can let me know the reason for regexp, or if you have installed in similar setup and how, that will be helpful. -- ?php echo 'Just another PHP saint'; ? 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 -~--~~~~--~~--~--~---
rendering issue
I've worked on this site for awhile, and all through development it was fine. Now it's on the production server and it has one really bizarre issue. The views are always rendered. Sometimes though, it will render the view without the layout. I don't understand why it's behaving in such a bizarre way, but if anyone has any ideas please let me know! -kb --~--~-~--~~~---~--~~ 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 Pagination SQL Injection
On Jul 4, 9:58 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: It is not needed either dbo level when using these conventions. I'm sorry, I meant Sanitize::escape() snip It is not needed either, the core handles everything if you follow conventions. The read() method handles it. But, if you have any link or resource for handling situation like search form, that will be very helpful. -- ?php echo 'Just another PHP saint'; ? 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: how to cache all the view in call ?
On Jul 5, 2:45 pm, wluigi [EMAIL PROTECTED] wrote: the question was not how to use cache but how to generate de cached contente for every action of my site every morning, so that the first people how use the site can take benefits of the cached view. snip Set up cron to delete cache folders every morning? -- ?php echo 'Just another PHP saint'; ? 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: Cache Elements for Different Users
Found a way to do it using cake without modifying the core libs. This is a workaround, but does the job. $this-element('tagCloud', array('cache'='+1 day', 'plugin'= $userId)); so this would create the file 'element_$userId_tagCloud' in the cache folder for views. Now to delete it, $this-clearCache('element_$userId_tagCloud', 'views', ''); I am faking plugin to be the userid, but this works and does my job. Hopefully, this might help someone else. Cheers, Ketan ;-) Chris Hartjes wrote: On 7/5/07, Ketan Patel [EMAIL PROTECTED] wrote: Can some one pls shed some light here. I don't think Cake can help you out there. What you might have to do is code your element in such a way that it does the caching itself based on a unique ID. You might consider a small file-based caching system. Not easy, but what you're asking for isn't easy. -- 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 -~--~~~~--~~--~--~---
using a join rather than multiple selects
I have a model called Section, just an id and a section name, similar to category Each section has many FormFields, so the FormField model has a section_id Is there a way to $section-findAll() with a join, rather than cake iterating through all the returned sections and doing a select on the form_fields table for every one. In other words, tell cake to select Section.id,Section.section,FormField.* from sections as section, form_fields as Formfield where 1=1 and Section.id = FormField.section_id Is the only way to do this by adding the finderQuery in the model definition? 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: Cache Elements for Different Users
Thanks Rajesh, to get me going in right direction. Ketan R. Rajesh Jeba Anbiah wrote: On Jul 5, 6:03 pm, Ketan Patel [EMAIL PROTECTED] wrote: Currently I do ?php echo $this-element('tagCloud', array('cache'='+1 day')); ? Element 'tagCloud' : ?php $this-requestAction('controller'='tag', 'action'='generateTagCloud'); ? What I would want to do is to have a cached element individual to each user? So it could be like 'tagCloud_user1', 'tagCloud_user2',... so on. but I could n't find anything in the code that really does that? snip What about passing params? $this-element('tagCloud', array('cache'='+1 day', 'user_id'=10) -- ?php echo 'Just another PHP saint'; ? 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: CakePHP 1.2 + Auth component (Auth::validate)
On 5 Lip, 15:33, danfreak [EMAIL PROTECTED] wrote: Dunno if this can help, but I managed as explained in the following post: =http://groups.google.com/group/cake-php/t/871ff4c536bc1e00 Thanks for this post, it helped mi very much to get familiar with Auth component :) However, I don't want to use $this - Auth - allow('action'); --~--~-~--~~~---~--~~ 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: Can't use components relying on startup() in beforeFilter
I have a similar problem: I use cake 1.2.0.5146alpha. In my controller I have a beforeFilter() method like this: --- if($this-Session-check('Auth.User')){ $this-reg(); } else{ $this-redirect(array('controller'='mytests'), null, true); exit(); } --- And then in another component I'm using (a modified version of the Form_Wizard) I have the following startup() function --- function startup($controller) { $this-controller= $controller; $this-Session= $controller-Session; $this-params = $controller-params; $this-data = $controller-data; } --- Without the beforeFilter() function everything works great. with it I get the following error: Fatal error: Call to a member function check() on a non-object in C: \www\cake_quest\app\controllers\components\form_wizard.php on line 140 Any clue on how to solve this conflict? Cheers Dan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
l18n :: Is __() the same as __c() with LC_MESSAGES ?
Hi, i have a question about translation possibilities in 1.2. l18n :: Is __() the same as __c() with LC_MESSAGES ? Tanks in advance dolce --~--~-~--~~~---~--~~ 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: Can't use components relying on startup() in beforeFilter
A bit more code from the Form_Wizard -- class FormWizardComponent extends Object { var $ways = null; var $_prefixWizard; var $_wizardData = array(); var $_way = null; var $_fctname; var $_curstep; var $controller; var $params; var $data; var $Session; /** * startup the Wizard * * @param array $ways An array containing all the wizard ways * @param string $prefix Wizard session var names are prefixed by $prefix * @return */ function startup($controller) { $this-controller= $controller; $this-Session= $controller-Session; $this-params = $controller-params; $this-data = $controller-data; } -- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
beforeSave question
Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: beforeSave question
you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: install partially failed
On 7/5/07, rtanz [EMAIL PROTECTED] wrote: any help please? Did you read the manual on how to install CakePHP? Sounds like you missed a few steps (hint: mod_rewrite) -- 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: CakePHP 1.2 + Auth component (Auth::validate)
Try this then in your app_controller: -- $this-Auth-allow('*'); -- It should work as wildcard for every action. Dan On 5 Lug, 18:24, Pillow [EMAIL PROTECTED] wrote: On 5 Lip, 15:33, danfreak [EMAIL PROTECTED] wrote: Dunno if this can help, but I managed as explained in the following post: =http://groups.google.com/group/cake-php/t/871ff4c536bc1e00 Thanks for this post, it helped mi very much to get familiar with Auth component :) However, I don't want to use $this - Auth - allow('action'); --~--~-~--~~~---~--~~ 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: install partially failed
any help please? On Jul 4, 11:09 pm, rtanz [EMAIL PROTECTED] wrote: hi i put cakephp on a /cake folder in my document root, the problem is that when i go to localhost/cake the css and images of the cake index page are not being shown, how can i fix 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: beforeSave question
Ah, I see now. Thanks for spelling that out for me. It works quite well :) So parent::beforeSave() essentially tells the model to use the beforeSave callback? Walker Hamilton wrote: function beforeSave() { if(isset($this-data['ItemData']['common_name'])) $this-data['Item']['name'] = $this-data['ItemData']['common_name']; return parent::beforeSave(); } On Jul 5, 12:54 pm, Brian [EMAIL PROTECTED] wrote: I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: beforeSave question
function beforeSave() { if(isset($this-data['ItemData']['common_name'])) $this-data['Item']['name'] = $this-data['ItemData']['common_name']; return parent::beforeSave(); } On Jul 5, 12:54 pm, Brian [EMAIL PROTECTED] wrote: I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: Why dispatcher return a blank page?
I run another test today to compare between my pc and sf and they both have the same [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) But on sf I got a blank page verse a Cake sample page on the pc. Brother! This is hard to track down! On Jul 4, 2:27 pm, chanh.ong [EMAIL PROTECTED] wrote: I found something interesting but don't know what! At sf.net [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = dde3c1f5760fa123c1c0436135c6399f [path] = /caketest/ [lastError] = 1 On my pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = d9fd8457f94661075e763061f6305e20 [path] = /cake_1.2.0.5146alpha/ [lastError] = On Jul 4, 2:19 pm, chanh.ong [EMAIL PROTECTED] wrote: On line 526 in _invoke I put my debug right after $output = call_user_func_array(array($controller, $params['action']), empty($params['pass'])? null: $params['pass']); I got lot of output on my pc here at the bin: http://bin.cakephp.org/view/751268208 But on sf.net same line but I just got blank: So the problem in at this line 526 Here is the bin for before line 526:http://bin.cakephp.org/view/771816764 The debug is set to 3. Please let me know what you see from a Cake expert eyes. Thanks On Jul 4, 1:39 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 4, 10:27 pm, chanh.ong [EMAIL PROTECTED] wrote: Here is the bin of the debugging session: === BEFORE _invoke function call I got something invoke may aswell be called do everything. You need to debug yourself to find the (much) lower cause for your blank page and then figure out what on your server is the cause. I do hope that you already set debug to 0 btw.. 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: Why dispatcher return a blank page?
That was because my pc version is a few days older then the sf.net version so I download the latest nightly build on both so I can compare them side by side and here is what I got. On sf.net--- [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array (--- note: this error on sf but what is the config that doesn't exist on sf?) ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = 6e5d250462f53d7dc6eabfded1f0dea5 [path] = /caketest/ [lastError] = 1 [security] = high On the pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = e368c4b11edb94357c396b2d091fb0bc [path] = /1.2.x.x_04.07.2007/ [lastError] = [security] = high On Jul 5, 11:01 am, chanh.ong [EMAIL PROTECTED] wrote: I run another test today to compare between my pc and sf and they both have the same [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) But on sf I got a blank page verse a Cake sample page on the pc. Brother! This is hard to track down! On Jul 4, 2:27 pm, chanh.ong [EMAIL PROTECTED] wrote: I found something interesting but don't know what! At sf.net [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = dde3c1f5760fa123c1c0436135c6399f [path] = /caketest/ [lastError] = 1 On my pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = d9fd8457f94661075e763061f6305e20 [path] = /cake_1.2.0.5146alpha/ [lastError] = On Jul 4, 2:19 pm, chanh.ong [EMAIL PROTECTED] wrote: On line 526 in _invoke I put my debug right after $output = call_user_func_array(array($controller, $params['action']), empty($params['pass'])? null: $params['pass']); I got lot of output on my pc here at the bin: http://bin.cakephp.org/view/751268208 But on sf.net same line but I just got blank: So the problem in at this line 526 Here is the bin for before line 526:http://bin.cakephp.org/view/771816764 The debug is set to 3. Please let me know what you see from a Cake expert eyes. Thanks On Jul 4, 1:39 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 4, 10:27 pm, chanh.ong [EMAIL PROTECTED] wrote: Here is the bin of the debugging session: === BEFORE _invoke function call I got something invoke may aswell be called do everything. You need to debug yourself to find the (much) lower cause for your blank page and then figure out what on your server is the cause. I do hope that you already set debug to 0 btw.. 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: beforeSave question
If you defined function beforeSave() in your controller then essentially you are overriding the beforeSave function defined in AppController and its parent Controller. So by calling parent::beforeSave() you are telling, you want to call the beforeSave method of the parent class which AppController. Ketan Brian wrote: Ah, I see now. Thanks for spelling that out for me. It works quite well :) So parent::beforeSave() essentially tells the model to use the beforeSave callback? Walker Hamilton wrote: function beforeSave() { if(isset($this-data['ItemData']['common_name'])) $this-data['Item']['name'] = $this-data['ItemData']['common_name']; return parent::beforeSave(); } On Jul 5, 12:54 pm, Brian [EMAIL PROTECTED] wrote: I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: beforeSave question
Yeah, what ketan said. It's not telling your model to use a callback. it's making it so that multiple levels of the (inherited) beforeSave function ( App Model Class - Model Name Class ) all get run. On Jul 5, 1:33 pm, Ketan Patel [EMAIL PROTECTED] wrote: If you defined function beforeSave() in your controller then essentially you are overriding the beforeSave function defined in AppController and its parent Controller. So by calling parent::beforeSave() you are telling, you want to call the beforeSave method of the parent class which AppController. Ketan Brian wrote: Ah, I see now. Thanks for spelling that out for me. It works quite well :) So parent::beforeSave() essentially tells the model to use the beforeSave callback? Walker Hamilton wrote: function beforeSave() { if(isset($this-data['ItemData']['common_name'])) $this-data['Item']['name'] = $this-data['ItemData']['common_name']; return parent::beforeSave(); } On Jul 5, 12:54 pm, Brian [EMAIL PROTECTED] wrote: I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: beforeSave question
I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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: beforeSave question
OK I think I've got it now, thank you both very much for your help. On Jul 5, 1:44 pm, Walker Hamilton [EMAIL PROTECTED] wrote: Yeah, what ketan said. It's not telling your model to use a callback. it's making it so that multiple levels of the (inherited) beforeSave function ( App Model Class - Model Name Class ) all get run. On Jul 5, 1:33 pm, Ketan Patel [EMAIL PROTECTED] wrote: If you defined function beforeSave() in your controller then essentially you are overriding the beforeSave function defined in AppController and its parent Controller. So by calling parent::beforeSave() you are telling, you want to call the beforeSave method of the parent class which AppController. Ketan Brian wrote: Ah, I see now. Thanks for spelling that out for me. It works quite well :) So parent::beforeSave() essentially tells the model to use the beforeSave callback? Walker Hamilton wrote: function beforeSave() { if(isset($this-data['ItemData']['common_name'])) $this-data['Item']['name'] = $this-data['ItemData']['common_name']; return parent::beforeSave(); } On Jul 5, 12:54 pm, Brian [EMAIL PROTECTED] wrote: I'm still a little confused. So I keep what I have right now ($this-data[) in my beforeSave() and then do what? Walker Hamilton wrote: you shouldn't need to create a hidden field called 'name'. just do the assignation in beforeSave. you need to make sure your beforeSave in the model returns parent::beforeSave On Jul 5, 12:19 pm, Brian [EMAIL PROTECTED] wrote: Here's a quick synopsis of the scenario: There's a menu, which has items, and these have a name and price. I also have a table in a separate database that has a ton of information on every item. I've got an AutoCompleter set up with this third table(ItemData, field 'common_name') and what I would like to do is take whatever value is in the AutoCompleted input field when the form is submitted and treat it as the 'name' property for the Item. My initial thought was to use the beforeSave() function in my Item model with something like this: $this-data['Item']['name'] = $this-data['ItemData']['common_name']; I made a hidden field with the name attribute as data[Item][name] but it doesn't work. Anyone else done something like this? --~--~-~--~~~---~--~~ 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 + Auth component (Auth::validate)
On 5 Lip, 19:38, danfreak [EMAIL PROTECTED] wrote: Try this then in your app_controller: -- $this-Auth-allow('*'); -- It should work as wildcard for every action. I said in my first post I can do it. But I would rather to do that in right way :) Hmm, or maybe it's right and the only way? Anyway, thanks for interest :) --~--~-~--~~~---~--~~ 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: l18n :: Is __() the same as __c() with LC_MESSAGES ?
its the same - i've tested On 5 Jul., 18:32, dolce [EMAIL PROTECTED] wrote: Hi, i have a question about translation possibilities in 1.2. l18n :: Is __() the same as __c() with LC_MESSAGES ? Tanks in advance dolce --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Custom SQL Query
Hey everyone! agian :) I'm having another problem now, this time with custom SQL queries. I want to get the a count of how many sounds a user ID has uploaded into the database, this is the SQL query: SELECT count(*) as c FROM data_points p join des_walks w WHERE p.des_walk_id = w.id AND w.com_user_id = 1 The com_user_id would come from my HTMLsetelct in the view. What I'm stuck on is getting this query submitted and then being able to use the $result. Heres my controller code: function index() { $this-DataPoint-recursive = 0; $this-set('datapoints', $this-DataPoint-findAll()); $comUser = $this-ComUser-generateList('id'); $this-set('comUser', $comUser); $sql = 'SELECT count(*) as c ' . ' FROM data_points p join des_walks w ' . ' WHERE p.des_walk_id = w.id AND w.com_user_id = ' .$comUser; $result = $this-DataPoint-query($sql); $this-set('data', $this-DataPoint-query($sql)); print_r($data); } I think I'm meant to get an array from the query() function but when I try to check using print_r I get the following error: Notice: Undefined variable: data in /Library/WebServer/Documents/cake/ app/controllers/data_points_controller.php on line 25 Should the print_r be in the controller or should that be in the view? I'm sure I'm doing something wrong and I've been on the forum for the last hour looking for an answer but now I'm completely stuck 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 SQL Query
On 7/5/07, mussond [EMAIL PROTECTED] wrote: Should the print_r be in the controller or should that be in the view? In the view. -- 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: Why dispatcher return a blank page?
I just notice something: sf.net uses PHP Version 4.3.10 and see On sf.net--- [Session] = sessioncomponent Object -- notice the object name all small case On the pc: [Session] = SessionComponent Object - notice the object name in camel case Is there an issue with php 4.3.10? Thanks On Jul 5, 11:30 am, chanh.ong [EMAIL PROTECTED] wrote: That was because my pc version is a few days older then the sf.net version so I download the latest nightly build on both so I can compare them side by side and here is what I got. On sf.net--- [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array (--- note: this error on sf but what is the config that doesn't exist on sf?) ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = 6e5d250462f53d7dc6eabfded1f0dea5 [path] = /caketest/ [lastError] = 1 [security] = high On the pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = e368c4b11edb94357c396b2d091fb0bc [path] = /1.2.x.x_04.07.2007/ [lastError] = [security] = high On Jul 5, 11:01 am, chanh.ong [EMAIL PROTECTED] wrote: I run another test today to compare between my pc and sf and they both have the same [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) But on sf I got a blank page verse a Cake sample page on the pc. Brother! This is hard to track down! On Jul 4, 2:27 pm, chanh.ong [EMAIL PROTECTED] wrote: I found something interesting but don't know what! At sf.net [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = dde3c1f5760fa123c1c0436135c6399f [path] = /caketest/ [lastError] = 1 On my pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = d9fd8457f94661075e763061f6305e20 [path] = /cake_1.2.0.5146alpha/ [lastError] = On Jul 4, 2:19 pm, chanh.ong [EMAIL PROTECTED] wrote: On line 526 in _invoke I put my debug right after $output = call_user_func_array(array($controller, $params['action']), empty($params['pass'])? null: $params['pass']); I got lot of output on my pc here at the bin: http://bin.cakephp.org/view/751268208 But on sf.net same line but I just got blank: So the problem in at this line 526 Here is the bin for before line 526:http://bin.cakephp.org/view/771816764 The debug is set to 3. Please let me know what you see from a Cake expert eyes. Thanks On Jul 4, 1:39 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 4, 10:27 pm, chanh.ong [EMAIL PROTECTED] wrote: Here is the bin of the debugging session: === BEFORE _invoke function call I got something invoke may aswell be called do everything. You need to debug yourself to find the (much) lower cause for your blank page and then figure out what on your server is the cause. I do hope that you already set debug to 0 btw.. 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: Foreign keys
Ketan Patel The problem is the foreignKeys. You do not have the foreignKey constraint satisfied and that's why MySql is complaining. ForeignKeys means that for that value, you have the entry in the foreign Table. Hi Ketan, thanks for your kind reply. However, let me explain the problem more accurately: this error seem to occur with every record I try to put in the table, even with those record that satisfy the costraints. The record I'm trying to insert satisfies all the costraints, as I checked over and over; however, the error occurs, and it occurs even when I remove from the query the fields that are foreign keys. The query is like that INSERT INTO Books (ID_Book, ID_Author, ID_Nation,ID_Publisher) VALUES (32,27,101,4) and in the foreign tables there are an author with ID 27,a nation with ID 101, and a publisher with ID 4. All the constraints seem to be satisfied, but the error occurs. Do you have any suggestion? Thank you 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 -~--~~~~--~~--~--~---
Re: Custom SQL Query
** Sorry if this comes up twice, my net crashed so I don't know if my 1st reply made it ** Cheers, I put it in the view but now all I get reported is 1. I guess my sql array bit is wrong? On Jul 5, 3:04 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/5/07, mussond [EMAIL PROTECTED] wrote: Should the print_r be in the controller or should that be in the view? In the view. -- 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 -~--~~~~--~~--~--~---
Newbie Sessions ?
Creating a Shopping Cart, and am wondering if when you add values to a session, does it overwrite the current contents in the session? For example: $this-Session-write('ShoppingCart.id', $id); $this-Session-write('ShoppingCart.name', $name); $this-Session-write('ShoppingCart.virtual', $virtual); $this-Session-write('ShoppingCart.price', $price); Having this code, if the first time i passed an $id of 4, then next time i added an $id of 6, will 6 overwrite 4 or will be added as another row in the session? --~--~-~--~~~---~--~~ 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 manaul
Hi, Is there an updated 1.2 manual in pdf format for download anywhere on the cakephp.org website? 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: 1.2 manaul
Unluckily not yet! I suggest you to look in this forum, and directly into the comments in the code. There also is an API online= http://api.cakephp.org/1.2/ Just be carefull: the API is for 1.2.0.5137 while the current version is 1.2.0.5146alpha + ask via IRC channel= 1.2.0.5137 Dan + there will be a book coming out, but who knows when (it was expected this July) http://www.amazon.co.uk/CakePHP-Recipes-Fabio-Cevasco/dp/0321497732 --~--~-~--~~~---~--~~ 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: Why dispatcher return a blank page?
I found this: In 1.2, it gaves me sessioncomponent object name on sf.net: $this-controller-{$component} = new $componentCn($param); $loaded[$component] = $this-controller-{$component}; In 1.1, it gaves me SessionComponent object name on sf.net $this-__controller-{$component} = new $componentCn($param); $loaded[$component] = $this-__controller-{$component}; The class name is all lower case on sf in version 1.2 verse camel case in 1.1 and that is the cause of my blank page. Why is change in the way the object are created? Thanks On Jul 5, 3:17 pm, chanh.ong [EMAIL PROTECTED] wrote: I just notice something: sf.net uses PHP Version 4.3.10 and see On sf.net--- [Session] = sessioncomponent Object -- notice the object name all small case On the pc: [Session] = SessionComponent Object - notice the object name in camel case Is there an issue with php 4.3.10? Thanks On Jul 5, 11:30 am, chanh.ong [EMAIL PROTECTED] wrote: That was because my pc version is a few days older then the sf.net version so I download the latest nightly build on both so I can compare them side by side and here is what I got. On sf.net--- [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array (--- note: this error on sf but what is the config that doesn't exist on sf?) ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = 6e5d250462f53d7dc6eabfded1f0dea5 [path] = /caketest/ [lastError] = 1 [security] = high On the pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = e368c4b11edb94357c396b2d091fb0bc [path] = /1.2.x.x_04.07.2007/ [lastError] = [security] = high On Jul 5, 11:01 am, chanh.ong [EMAIL PROTECTED] wrote: I run another test today to compare between my pc and sf and they both have the same [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) But on sf I got a blank page verse a Cake sample page on the pc. Brother! This is hard to track down! On Jul 4, 2:27 pm, chanh.ong [EMAIL PROTECTED] wrote: I found something interesting but don't know what! At sf.net [Session] = sessioncomponent Object ( [__active] = 1 [valid] = 1 [error] = Array ( [2] = Config doesn't exist [1] = Session is valid ) [_userAgent] = dde3c1f5760fa123c1c0436135c6399f [path] = /caketest/ [lastError] = 1 On my pc: [Session] = SessionComponent Object ( [__active] = 1 [valid] = 1 [error] = [_userAgent] = d9fd8457f94661075e763061f6305e20 [path] = /cake_1.2.0.5146alpha/ [lastError] = On Jul 4, 2:19 pm, chanh.ong [EMAIL PROTECTED] wrote: On line 526 in _invoke I put my debug right after $output = call_user_func_array(array($controller, $params['action']), empty($params['pass'])? null: $params['pass']); I got lot of output on my pc here at the bin: http://bin.cakephp.org/view/751268208 But on sf.net same line but I just got blank: So the problem in at this line 526 Here is the bin for before line 526:http://bin.cakephp.org/view/771816764 The debug is set to 3. Please let me know what you see from a Cake expert eyes. Thanks On Jul 4, 1:39 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 4, 10:27 pm, chanh.ong [EMAIL PROTECTED] wrote: Here is the bin of the debugging session: === BEFORE _invoke function call I got something invoke may aswell be called do everything. You need to debug yourself to find the (much) lower cause for your blank page and then figure out what on your server is the cause. I do hope that you already set debug to 0 btw.. 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: 1.2 manaul
You can get an updated version of Cake 1.2 manual here: https://cakeforge.org/plugins/scmsvn/viewcvs.php/sandbox/1.2/?root=cakedocs It isn't complete, though. + there will be a book coming out, but who knows when (it was expected this July) As far as I know, CakePHP Recipe will never be published. http://www.h3rald.com/blog/42 On Jul 6, 7:30 am, roliver [EMAIL PROTECTED] wrote: Hi, Is there an updated 1.2 manual in pdf format for download anywhere on the cakephp.org website? 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: Newbie Sessions ?
When you add values to the session, the old one will be overwritten (if exists) On Jul 6, 6:35 am, r557 [EMAIL PROTECTED] wrote: Creating a Shopping Cart, and am wondering if when you add values to a session, does it overwrite the current contents in the session? For example: $this-Session-write('ShoppingCart.id', $id); $this-Session-write('ShoppingCart.name', $name); $this-Session-write('ShoppingCart.virtual', $virtual); $this-Session-write('ShoppingCart.price', $price); Having this code, if the first time i passed an $id of 4, then next time i added an $id of 6, will 6 overwrite 4 or will be added as another row in the session? --~--~-~--~~~---~--~~ 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: New CakePHP Application Launches
Hi guys, Thanks very much for all the feedback. Keep it coming! Yes, one of the issues is the reliance on JS - it definitely makes it difficult for the site to be usable on older browsers or with disabled JS. We made that compromise for now, but something to examine - we'll look at it for sure. Feedback buttons should be working, but perhaps not with JS - we'll be adding the email as well - [EMAIL PROTECTED] As for the geo-tagging, stay posted - some features in development there. :) Right now what we need most are articles - so if you live anyplace even remotely exotic (Wisconsin is nice this time of year :)), pls post! Thanks, Omar On Jul 5, 12:12 am, MJ Ray [EMAIL PROTECTED] wrote: oms [EMAIL PROTECTED] wrote: We've just launchedwww.trippert.com- a travel community site built using cakePHP. Please help us out by checking it out, giving us feedback [...] How do you expect people to give feedback? The feedback link in the top bar does nothing and the contact link at the bottom says This page will contain contact information. My feedback was that some of the alt tags seem silly (Logo should be replaced by Trippert for example) and some of the colour choices make the site confusing for browsers which don't load images or use javascript (failing to ensure sufficient contrast, for example). With images but without Javascript, main pictures never load - you'd only ever see the throbber. The pages don't scale down to 512px width (for people using 1x2 or 2x2 tiled browsers on 1024px screens) and stuff just gets cut off the right-hand-side with no horizontal scroll bar in Firefox 1. All of these should be fixed and usually can be fixed quite easily on a CakePHP site - there's no need to be inaccessible. That said, the site idea and general implementation seems pretty cool, like a much easier-to-use TripAdvisor. It could go a lot of places and I can see how you could make money from it. One obvious user-aimed improvement idea is to add meta ICBM to each location page and submit them to geoURL and similar sites. Regards, -- MJ Ray [EMAIL PROTECTED] www.ttllp.co.uk+44(0)844 4437 237 Webmaster since 1994, programmer, statistician, writer, more. Turo Technology LLP, reg'd in England+Wales, 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: using a join rather than multiple selects
Cake does not perform JOINs on hasMany, but it does for belongsTo. So if you change your query from $conditions = array( 'Section.id'=$section_id); $results = $this-Section-findAll( $conditions ); // multiple queries $results = $this-FormField-findAll( $conditions ); // single query then it will execute in a single query, as long as you have the association FormField belongsTo Section. You can have conditions that go across the join like that. --~--~-~--~~~---~--~~ 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: Select which populate another select
Good sample here : http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/ On Jul 5, 4:53 pm, Jon Molesa [EMAIL PROTECTED] wrote: *On Thu, Jul 05, 2007 at 07:36:06AM -0700 ricarou51 [EMAIL PROTECTED] wrote: From: ricarou51 [EMAIL PROTECTED] To: Cake PHP cake-php@googlegroups.com Subject: Select which populate another select Date: Thu, 05 Jul 2007 07:36:06 -0700 Hello ! I have a select tag in a view and I would like to populate a second select tag in the same view with the id selected of the first select tag . It means for example, a select tag with id and province name, and i would like to populate a second select tag with id and town name with the id of province selected before. How can I do this ? I'm not expert, but the most common method would be to use some javascript (AJAX), watch the event for the first select, then populate the second. OTOH, post/get could work too. Thanks -- Jon Molesa [EMAIL PROTECTED] if you're bored or curioushttp://rjmolesa.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: regarding javascript
Thanks,i had to implement this in cakephp.I got the answer through your another post.again thanks. On Jul 2, 1:45 pm, Grant Cox [EMAIL PROTECTED] wrote: What does this have to do with CakePHP? Search google for javascript button submit form and javascript button click. Come back here if you have a CakePHP specific question. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---