Re: Alterar o URL padrão
Não funcionou :D Mas, resolvi utilizando um método bem interessante, alterei o nome da controller e da classe para o nome que quero usar, funcionou perfeitamente. Falopa! --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos 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: Alterar o URL padrão
Mas vc sempre pode usar nomes em portugues para seus Modelos e Controles, eu, particularmente, sempre uso... Caso de algum problema com a pluralização, basta alterar o arquivo inflections.php dentro da pasta Config. Já deu uma olhada naquele código fonte que o Tulio disponibilizou no site dele? Ele fez tudo aportuguesado. On 1 Set, 09:11, hostdesigner [EMAIL PROTECTED] wrote: Não funcionou :D Mas, resolvi utilizando um método bem interessante, alterei o nome da controller e da classe para o nome que quero usar, funcionou perfeitamente. Falopa! --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos 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: Aplicação Cake
Fernando, Bom vamos começar com o sguinte conselho. Aprender a utilizar um framwork é uma ótima idéia e vai te ajudar muito. Porém se você tem este projeto que é pra ontem não tem nem porque arriscar seu projeto, aconselho você deixar o seu aprendizado de cakePHP para um próximo projeto onde o prazo não seja tão curto e você possa estudar principalmente nas horas extras. Agora falando sobre como iniciar. Uma boa dica é você gastar um tempinho assistindo os videos tutoriais do tuliofaria.net, o mesmo posta sempre aqui no grupo ajudando quem precisa. Depois de assistir recomendo ler o manual inteiro do cakephp.org e ai sim pegue um projeto pequeno para testar o que aprendeu. Faça uns cadastros simples e procure utilizar todos os relacionamentos para aprender como trabalhar legal com o cake, quando pintar dúvidas, o que concerteza vai ocorrer você recorre primeiro ao manual e ou API do cakephp.org, não encontrando procure aqui no grupo que pode ser que sua dúvida ja esta respondida em algum grupo, caso não encontre então basta postar sua dúvida que vamos lhe ajudar no que conseguirmos. abraços man e bem vindo ao mundo cake. (esse mundo val muito a pena) Marcio Trindade On 30 ago, 19:27, Fernando Aires [EMAIL PROTECTED] wrote: Boa Noite Galera, Gostaria de saber como faço para transformar essa aplicação para cake. Para entender quando faço um site em PHP, ainda não uso OO ou Framework. Quero começar mais estou com receio pois este site e para amanhã. Já dei uma olhada no bake e acho que resolve pois os cadastros são simples. Faço a seguinte divisão: Raiz (Coloco todos arquivos do site) Obs: na raiz tem o login na index.php que valida o login em um arquivo dentro de admin. E se for valido redireciona para index do admin ou inválido redireciona para index.php do site. -index.php - Admin - Noticia(crud) - Link (crud) - etc. - geral - css (estilos - js (javascript) - inc ( arquivos includes) - img (imagens) Gostaria que me ajudasse como colocar a mesma pasta admin no cake com os cadastros? E o mais importante: tenho dois layouts um para site e outro para administração como configuro? Atenciosamente, Fernando. --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos 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: Aplicação Cake
Olá, peguei um projeto, não muito grande, mas busquei varias ferramentas para agilizar o desenvolvimento e cheguei no cakephp. Foi desafio e um risco, sendo que conseguir desenvolver o sistema através do cake e entrei o sistema no prazo. Na verdade, calculei a curva de aprendizagem e verifiquei que conseguiria entregar no prazo. O importante que o resultado foi excelente!!! Tanto pra mim, tanto para o cliente, incluise já estamos negociando um outro sistema. Agora a decisão é sua. Eu não me arrependi! Geovane. On 9/1/07, Marcio Trindade [EMAIL PROTECTED] wrote: Fernando, Bom vamos começar com o sguinte conselho. Aprender a utilizar um framwork é uma ótima idéia e vai te ajudar muito. Porém se você tem este projeto que é pra ontem não tem nem porque arriscar seu projeto, aconselho você deixar o seu aprendizado de cakePHP para um próximo projeto onde o prazo não seja tão curto e você possa estudar principalmente nas horas extras. Agora falando sobre como iniciar. Uma boa dica é você gastar um tempinho assistindo os videos tutoriais do tuliofaria.net, o mesmo posta sempre aqui no grupo ajudando quem precisa. Depois de assistir recomendo ler o manual inteiro do cakephp.org e ai sim pegue um projeto pequeno para testar o que aprendeu. Faça uns cadastros simples e procure utilizar todos os relacionamentos para aprender como trabalhar legal com o cake, quando pintar dúvidas, o que concerteza vai ocorrer você recorre primeiro ao manual e ou API do cakephp.org, não encontrando procure aqui no grupo que pode ser que sua dúvida ja esta respondida em algum grupo, caso não encontre então basta postar sua dúvida que vamos lhe ajudar no que conseguirmos. abraços man e bem vindo ao mundo cake. (esse mundo val muito a pena) Marcio Trindade On 30 ago, 19:27, Fernando Aires [EMAIL PROTECTED] wrote: Boa Noite Galera, Gostaria de saber como faço para transformar essa aplicação para cake. Para entender quando faço um site em PHP, ainda não uso OO ou Framework. Quero começar mais estou com receio pois este site e para amanhã. Já dei uma olhada no bake e acho que resolve pois os cadastros são simples. Faço a seguinte divisão: Raiz (Coloco todos arquivos do site) Obs: na raiz tem o login na index.php que valida o login em um arquivo dentro de admin. E se for valido redireciona para index do admin ou inválido redireciona para index.php do site. -index.php - Admin - Noticia(crud) - Link (crud) - etc. - geral - css (estilos - js (javascript) - inc ( arquivos includes) - img (imagens) Gostaria que me ajudasse como colocar a mesma pasta admin no cake com os cadastros? E o mais importante: tenho dois layouts um para site e outro para administração como configuro? Atenciosamente, Fernando. --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos 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 -~--~~~~--~~--~--~---
Country - State combo box Ajax problem
Hi friends, As i have one form having Country and State combo box. Depend on country selected it will Fill up States automatically. Here is my Code : // file : edit.thtml //calling ajax functions function getstates(st) { country = $('country_name').value; alert(country); if(!country) $('mystatelist').innerHTML = 'select id=state_name name=data[User][state_name] disabledoptionSelect/option/ select'; else { url = root+'admin/users/update_select/?country='+country +'state='+st; //alert(url); new Ajax.Request(url,{method:get,onSuccess:function(transport){ $('mystatelist').innerHTML = 'select id=state_name name=data[User][state_name]'+transport.responseText+'/select'; //alert(transport.responseText); },onFailure:function(){alert('Failed to get states');}}); } } = Country and State Code : ?php //pr($this-data); die; //$countries[0]='Select'; //pr($countries); die; foreach($countries as $key=$value) { $countri[$value]=$value; } $carr=array(''='Select'); $countri = array_merge($countri,$carr); ksort($countri); $countrybill=$this-data['User']['Country']; // $selected = mystate; ? td colspan=2 ?php echo $html-selectTag('User/country_name', $countri , $countrybill, array('id'='country_name','onchange'='getstates()'), array(), false);? /td /tr tr td valign=topstrongState/Province/strong/td td colspan=2 span id=mystatelist select id=state_name name=data[User][state_name] disabled optionSelect/option /select /span /td /tr === Now please tell me what is the problem ?? Country is filled up from database table countries but after selecting country STATE combo is not filled up. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Country - State combo box Ajax problem
Hi friends, As i have one form having Country and State combo box. Depend on country selected it will Fill up States automatically. Here is my Code : // file : edit.thtml //calling ajax functions function getstates(st) { country = $('country_name').value; alert(country); if(!country) $('mystatelist').innerHTML = 'select id=state_name name=data[User][state_name] disabledoptionSelect/option/ select'; else { url = root+'admin/users/update_select/?country='+country +'state='+st; //alert(url); new Ajax.Request(url,{method:get,onSuccess:function(transport){ $('mystatelist').innerHTML = 'select id=state_name name=data[User][state_name]'+transport.responseText+'/select'; //alert(transport.responseText); },onFailure:function(){alert('Failed to get states');}}); } } = Country and State Code : ?php //pr($this-data); die; //$countries[0]='Select'; //pr($countries); die; foreach($countries as $key=$value) { $countri[$value]=$value; } $carr=array(''='Select'); $countri = array_merge($countri,$carr); ksort($countri); $countrybill=$this-data['User']['Country']; // $selected = mystate; ? td colspan=2 ?php echo $html-selectTag('User/country_name', $countri , $countrybill, array('id'='country_name','onchange'='getstates()'), array(), false);? /td /tr tr td valign=topstrongState/Province/strong/td td colspan=2 span id=mystatelist select id=state_name name=data[User][state_name] disabled optionSelect/option /select /span /td /tr === Now please tell me what is the problem ?? Country is filled up from database table countries but after selecting country STATE combo is not filled up. Please solve my 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: Weird slowness problem.
I would like to recommend to just try http://www.mod-top.org/ - download - compile (the module) - make php.ini to load it - look what is that take so much time - profit?!?!?! :) Paolo Gabrielli --~--~-~--~~~---~--~~ 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: Adding disabled property to option tags in select
And one day, it might get looked at ;) Mike On 01/09/07, Chris Hartjes [EMAIL PROTECTED] wrote: On 8/31/07, Daniel Ellis [EMAIL PROTECTED] wrote: I patched my version of cake to add the ability to make select options disabled. I assume this would be a useful feature for some, is there somewhere I should check it in? Go to http://trac.cakephp.org and submit your patch as a ticket under enhancements. -- 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 -- Mike Green Find yourself some misspelled ebay bargains! http://www.typingwand.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: DBDesigner to CakePHP Scaffold Tool Release Candidate.
I think bake.php is amazing, but this is even better (faster and more comfortable) in use. Great job! On Aug 30, 7:14 pm, Dérico Filho [EMAIL PROTECTED] wrote: Hi All, I released the dbdesigner2cake 1.0.0RC1, it's available for download at http://www.cirello.org/dbdesigner2cake/download.html and http://cakeforge.org/frs/?group_id=162 Soon I shall make a tutorial for it which shall approach from the database modelling up to source code generation. I hope you all use it and enjoy it as a complementary tool for bake.php. I aim for a more complete integration between them. Dérico Filho --~--~-~--~~~---~--~~ 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: back functionality
Technically the referrer header is an optional part of the http spec, so cannot always be relied upon (though most browsers do behave, you may get issues with odd proxies misbehaving). The only really reliable way to do this is to tag the previous page in your session (best in a beforeFilter / afterRender) and use that. But yeah, for the majority of circumstances Chris's method would work fine. Simon On Sep 1, 2:27 am, Chris Hartjes [EMAIL PROTECTED] wrote: On 8/31/07, rtanz [EMAIL PROTECTED] wrote: hi i would like to make a back button on some pages, how can i know the url of the previous page? thanks If you're in the controller, you can get the previous page via $this-referer(). I use it all the time to send people back to the page they were on before $this-redirect($this-referer()); -- 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: Cake Mysql UTF-8 :(
I solved my problems with UTF-8 by using this alter command after the creation of my database: ALTER DATABASE CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; And in cakephp database configuration: var $default = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'host', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'prefix' = '', 'encoding' = 'UTF8'); No need to change core classes. Oh.. and every editor I use for working with php and ctp files are using UTF-8 encoding too. And on the top of every web page I have also: meta content=text/html; charset=UTF-8 http-equiv=content-type / Regards Gonçalo Afonso On Aug 31, 6:03 pm, Mech7 [EMAIL PROTECTED] wrote: Thanks this works great with me in 1.2 :) would be nice if this was added in database.default.php or atleast in the comments. On Aug 31, 6:44 pm, djiize [EMAIL PROTECTED] wrote: if you have Cake 1.2, add 'encoding' = 'utf8' in conf/database.php if you have Cake 1.1, call query(SET NAME 'UTF8' ) just after connexion (don't remember if in database.php or app_model.php) On 31 août, 18:36, Mech7 [EMAIL PROTECTED] wrote: Ah that is great google can't handle them either :D here is what it looks with me: http://img124.imageshack.us/img124/2272/characterhellko6.gif On Aug 31, 6:30 pm, Mech7 [EMAIL PROTECTED] wrote: Does anybody know how to save utf8 charachters properly in Cake.. when i save special characters they get saved very weird in mysql for exmaple: becomes The database table is set to utf8_general_ci and in the html it is set to utf8 too.. meta http-equiv=Content-Type content=text/html; charset=utf-8 / The problem seems to come when saving to mysql, does anybody know how i can fix 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 -~--~~~~--~~--~--~---
What is Vogoo PHP and FreeTag PHP Lib
Hi friends, I am new for php and cakephp so I want to know that what is Vogoo PHP and FreeTag PHP Lib. will you please discribe 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: Cake Mysql UTF-8 :(
You should also send a HTTP header indicating your content is served as UTF-8. I think IE needs that under circumstances. -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de MrG wrote: I solved my problems with UTF-8 by using this alter command after the creation of my database: ALTER DATABASE CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; And in cakephp database configuration: var $default = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'host', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'prefix' = '', 'encoding' = 'UTF8'); No need to change core classes. Oh.. and every editor I use for working with php and ctp files are using UTF-8 encoding too. And on the top of every web page I have also: meta content=text/html; charset=UTF-8 http-equiv=content-type / Regards Gonçalo Afonso On Aug 31, 6:03 pm, Mech7 [EMAIL PROTECTED] wrote: Thanks this works great with me in 1.2 :) would be nice if this was added in database.default.php or atleast in the comments. On Aug 31, 6:44 pm, djiize [EMAIL PROTECTED] wrote: if you have Cake 1.2, add 'encoding' = 'utf8' in conf/database.php if you have Cake 1.1, call query(SET NAME 'UTF8' ) just after connexion (don't remember if in database.php or app_model.php) On 31 août, 18:36, Mech7 [EMAIL PROTECTED] wrote: Ah that is great google can't handle them either :D here is what it looks with me: http://img124.imageshack.us/img124/2272/characterhellko6.gif On Aug 31, 6:30 pm, Mech7 [EMAIL PROTECTED] wrote: Does anybody know how to save utf8 charachters properly in Cake.. when i save special characters they get saved very weird in mysql for exmaple: becomes The database table is set to utf8_general_ci and in the html it is set to utf8 too.. meta http-equiv=Content-Type content=text/html; charset=utf-8 / The problem seems to come when saving to mysql, does anybody know how i can fix 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: Cake CPU hungry
Do you know that for sure? If you lets say load the Users model in AppController, then it is more then likely that *all* of your other models are loaded b/c they are somehow associated with User. In AppController I only turn on othAuth and afaik it doesn't load any models if authorization is not required in a Controller. Here's part of debug($this) run in my pages_controller : [name] = Pages [helpers] = Array ( [0] = Html [1] = Text [2] = Form [3] = OthAuth [4] = tqlTools ) [uses] = [components] = Array ( [0] = othAuth [1] = Session ) . . [othAuth] = othAuthComponent Object ( ... [controller] = PagesController Object *RECURSION* ) No model loaded, I only don't like this *RECURSION* .. in a controller with like 6 models loaded there's a LOT of RECURSION.. do you have it as well ? My suggestion is to not work / rely on benchmark solutions that just hammer at your server too much - its very complex to create a realistic scenario that way (i.e. 20 users holding down on your front page or some other action is very different from each of them doing different things). The best way to make your app faster should be to get some profiler going and see what functions / parts of your app take the longest to load and then optimize them. Yeah, I'm taking a closer look on xdebug, I will post some results if I manage to run it. From there I'd keep an eye closely on the server load during traffic peaks which you can use to generate yourself some statistics to estimate when your current horse power will not be enough anymore. Then it is time to cluster and scale your architecture. So from some point there's a question where to put your resources : trying to optimize the code or buying and adding hardware to cope with a higher load. Anyway, I'm not an expert on the matter and you may be able diagnose things with your current benchmark setup as well - however I think its not the easiest path. Good luck and success with your app! Thanks! We've got more then 5000 facebook users in a first week and 1000 daily active users (new facebook metric), up to 13000 pageviews/ day so it's coming along nicely :) Best, Andrzej --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake CPU hungry
(i.e. 20 users holding down on your front page or some other action is very different from each of them doing different things) Yeah, I'm taking a closer look on xdebug, I will post some results if I manage to run it. Ups, I meant to write 'Holding down F5 on your front page here, but I think you got that. Yeah I'm currently looking into getting xdebug to run myself - you don't happen to use OS X for development so you could share your findings ^^? In AppController I only turn on othAuth and afaik it doesn't load any models if authorization is not required in a Controller. Here's part of debug($this) run in my pages_controller : You may get better results using get_included_files http://de.php.net/manual/en/function.get-included-files.php / get_declared_classes http://de.php.net/manual/en/function.get-declared-classes.php or using a profiler, but yeah your results seem to indicate no models being loaded I think. No model loaded, I only don't like this *RECURSION* .. in a controller with like 6 models loaded there's a LOT of RECURSION.. do you have it as well ? There is not much you can do against that recursion and its not really a problem for performance (I think). What you could try is to write your own debug() function that keeps a hash of items already iterated through and makes sure inifinite recursions will not be followed (my experience has shown that the print_r behavior here is inconsistent). So from some point there's a question where to put your resources : trying to optimize the code or buying and adding hardware to cope with a higher load. I'm usually for throwing more CPU cycles at things instead of development time as the latter is more expensive and better spend on improving the user experience / maintainability rather then the speed. That being said, this is not meant as an excuse for not looking into obvious bottle necks / scalability issues and resolving them. But after that, you reach a point where optimizing things becomes more and more difficult and may even make your application harder to maintain, thats the point where I'd say throw more servers at it instead of developers. Thanks! We've got more then 5000 facebook users in a first week and 1000 daily active users (new facebook metric), up to 13000 pageviews/ day so it's coming along nicely :) Oh its a Facebook app - cool : ). Add me to your friends and tell me what app it is so I can give it a try (my profile is: http://hs.facebook.com/profile.php?id=1114020732). Oh and congratulations to your success so far, thats pretty cool. Hope you'll find some time into sharing your experiences in using and scaling CakePHP for this at some point with the community : ). -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de thequietlab wrote: Do you know that for sure? If you lets say load the Users model in AppController, then it is more then likely that *all* of your other models are loaded b/c they are somehow associated with User. In AppController I only turn on othAuth and afaik it doesn't load any models if authorization is not required in a Controller. Here's part of debug($this) run in my pages_controller : [name] = Pages [helpers] = Array ( [0] = Html [1] = Text [2] = Form [3] = OthAuth [4] = tqlTools ) [uses] = [components] = Array ( [0] = othAuth [1] = Session ) . . [othAuth] = othAuthComponent Object ( ... [controller] = PagesController Object *RECURSION* ) No model loaded, I only don't like this *RECURSION* .. in a controller with like 6 models loaded there's a LOT of RECURSION.. do you have it as well ? My suggestion is to not work / rely on benchmark solutions that just hammer at your server too much - its very complex to create a realistic scenario that way (i.e. 20 users holding down on your front page or some other action is very different from each of them doing different things). The best way to make your app faster should be to get some profiler going and see what functions / parts of your app take the longest to load and then optimize them. Yeah, I'm taking a closer look on xdebug, I will post some results if I manage to run it. From there I'd keep an eye closely on the server load during traffic peaks which you can use to generate yourself some statistics to estimate when your current horse power will not be enough anymore. Then it is time to cluster and scale your architecture. So from some point there's a question where to put your resources : trying to optimize the code or buying and adding hardware to cope with a higher load. Anyway, I'm not an expert on the matter and you may be able diagnose things with your current benchmark setup as well - however I think its
does $cakeDebug work?
Since this has been ignored for a while, I guess a lot of people don't really care for it much, but I do. I noticed that when I went to cake 1.2 it just died. Here's how I fixed it: Opened this file: cake\libs\view\templates\elements\dump.ctp changed: ?php print_r($this-controller); ? to ?php print_r($this); ? Opened this file: cake\libs\view\view.php changed: if (Configure::read() 2 $this-controller != null) { to if (Configure::read() 2 $this != null) { I guess from cake 1.2 we no longer populate $this-controller? Could one of the developers confirm this so that (if it's correct) we can get it into the next version? Thanks: -- Baz L Web Development 2.0: Web Design, CakePHP, Javascript http://www.WebDevelopment2.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: Cake Mysql UTF-8 :(
Ok so in my layouts i would have to have: ?php header('Content-Type: text/html; charset=utf-8'); ? Or is there a better way that it will always get used automatically with any layout ? On Sep 1, 2:58 pm, Felix Geisendörfer [EMAIL PROTECTED] wrote: You should also send a HTTP header indicating your content is served as UTF-8. I think IE needs that under circumstances. -- Felix -- My Blog:http://www.thinkingphp.org My Business:http://www.fg-webdesign.de MrG wrote: I solved my problems with UTF-8 by using this alter command after the creation of my database: ALTER DATABASE CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; And in cakephp database configuration: var $default = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'host', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'prefix' = '', 'encoding' = 'UTF8'); No need to change core classes. Oh.. and every editor I use for working with php and ctp files are using UTF-8 encoding too. And on the top of every web page I have also: meta content=text/html; charset=UTF-8 http-equiv=content-type / Regards Gonçalo Afonso On Aug 31, 6:03 pm, Mech7 [EMAIL PROTECTED] wrote: Thanks this works great with me in 1.2 :) would be nice if this was added in database.default.php or atleast in the comments. On Aug 31, 6:44 pm, djiize [EMAIL PROTECTED] wrote: if you have Cake 1.2, add 'encoding' = 'utf8' in conf/database.php if you have Cake 1.1, call query(SET NAME 'UTF8' ) just after connexion (don't remember if in database.php or app_model.php) On 31 août, 18:36, Mech7 [EMAIL PROTECTED] wrote: Ah that is great google can't handle them either :D here is what it looks with me: http://img124.imageshack.us/img124/2272/characterhellko6.gif On Aug 31, 6:30 pm, Mech7 [EMAIL PROTECTED] wrote: Does anybody know how to save utf8 charachters properly in Cake.. when i save special characters they get saved very weird in mysql for exmaple: becomes The database table is set to utf8_general_ci and in the html it is set to utf8 too.. meta http-equiv=Content-Type content=text/html; charset=utf-8 / The problem seems to come when saving to mysql, does anybody know how i can fix 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: Cake Mysql UTF-8 :(
Or is there a better way that it will always get used automatically with any layout ? I think the layout *is* the appropriate place to do this as one may have layouts with different encodings. However, if you want to define a 'default' encoding for all layouts (which you can then overwrite in them with another call to header()), I would put it in AppController::beforeRender() or beforeFilter (the latter might be a better place if you need the encoding to work with debug() calls inside your actions). HTH, -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de Mech7 wrote: Ok so in my layouts i would have to have: ?php header('Content-Type: text/html; charset=utf-8'); ? Or is there a better way that it will always get used automatically with any layout ? On Sep 1, 2:58 pm, Felix Geisendörfer [EMAIL PROTECTED] wrote: You should also send a HTTP header indicating your content is served as UTF-8. I think IE needs that under circumstances. -- Felix -- My Blog:http://www.thinkingphp.org My Business:http://www.fg-webdesign.de MrG wrote: I solved my problems with UTF-8 by using this alter command after the creation of my database: ALTER DATABASE CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; And in cakephp database configuration: var $default = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'host', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'prefix' = '', 'encoding' = 'UTF8'); No need to change core classes. Oh.. and every editor I use for working with php and ctp files are using UTF-8 encoding too. And on the top of every web page I have also: meta content=text/html; charset=UTF-8 http-equiv=content-type / Regards Gonçalo Afonso On Aug 31, 6:03 pm, Mech7 [EMAIL PROTECTED] wrote: Thanks this works great with me in 1.2 :) would be nice if this was added in database.default.php or atleast in the comments. On Aug 31, 6:44 pm, djiize [EMAIL PROTECTED] wrote: if you have Cake 1.2, add 'encoding' = 'utf8' in conf/database.php if you have Cake 1.1, call query(SET NAME 'UTF8' ) just after connexion (don't remember if in database.php or app_model.php) On 31 août, 18:36, Mech7 [EMAIL PROTECTED] wrote: Ah that is great google can't handle them either :D here is what it looks with me: http://img124.imageshack.us/img124/2272/characterhellko6.gif On Aug 31, 6:30 pm, Mech7 [EMAIL PROTECTED] wrote: Does anybody know how to save utf8 charachters properly in Cake.. when i save special characters they get saved very weird in mysql for exmaple: becomes The database table is set to utf8_general_ci and in the html it is set to utf8 too.. meta http-equiv=Content-Type content=text/html; charset=utf-8 / The problem seems to come when saving to mysql, does anybody know how i can fix 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 -~--~~~~--~~--~--~---
please comment on my design decision
Hi all, I am completing a project using cake where the application requires user profiles with several hundred, yes several hundred, questions/ fields. However, only about 20 of these are used in searching, sorting, etc., the rest are for display purposes only. So, I basically included those 20 main fields in my profiles table, and I added a text field called non_searcable. Then I just serialize all the other fields and store them there, unserialize them for display. I have seen a design where a 2 column table is employed, field_name and field_value, and all these fields are stored in that way. It just seems like a slow, painful method, and you end up with text type fields storing a string of 4 characters, storing numbers, etc. What do you think? For some reason my design doesn't feel 'elegant', but it works, although is did require a little trickery on the edit actions and view actions, bet Set::merge was awesome! Anyway, just curious. I put a lot of pressure on myself to come up with super engineered solutions, when often times I think small apps are over designed. TIA, 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: Join Log Results by Date
On 8/31/07, McFadly [EMAIL PROTECTED] wrote: Hi Chris - Thanks for ideas. Here's my implementation based on your suggestion: One immediate problem that presents itself is duplicate dates which would overwrite the $log keys, however, as your signature suggets I just built it, damnit! Its Friday night and time for a beer! Yeah, that occurred to me after I posted as well. Maybe a two-dimensional array with the date as the first key and then the entry # as the second. Those two should be unique enough I would think. -- 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: back functionality
On 9/1/07, Geoff Ford [EMAIL PROTECTED] wrote: To get around the referer issue you can use javascript and have Chris' method as a fallback. history.go(-1); Geoff, that's a good idea. Since I'm just getting into the swing of things with Javascript that never occurred to me. :) -- 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: Adding disabled property to option tags in select
On 9/1/07, Mike Green [EMAIL PROTECTED] wrote: And one day, it might get looked at ;) Mike In all fairness to the CakePHP dev group, every ticket that comes in does get looked at. Some don't get answered promptly but they get looked at. -- 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 -~--~~~~--~~--~--~---
Is there a console folder or program in cakePHP?????????
I am trying to install cakephp in eclipse and the instructions say ther is a statement to add console as C:\xampp\webroot\cake\cake\console where is this console located.??? I entered this statement and I didn't get anything Thanks Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: outputting results from a db in groups of common content
That worked brilliantly, thank you very much On Sep 1, 12:52 pm, Geoff Ford [EMAIL PROTECTED] wrote: Use an order by of type, name as the third option in the findAll() Then in your view you can do something like $current = ; foreach ($work in $works){ if ($work['Work']['type'] != $current) { // print heading } // print name and other details } Geoff --http://lemoncake.wordpress.com On Sep 1, 10:10 am, GunitMail [EMAIL PROTECTED] wrote: Hello! Ok here is how an entry in my database looks like: [Work] = Array ( [id] = 1 [name] = piece of work 1 [type] = Print [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) How would I go about getting cakePHP to output these on a page like: h2Print/h2 + piece of work 1 + piece of work 2 + piece of work 4 + piece of work 6 h2Digital/h2 + piece of work 3 + piece of work 5 So they are grouped together with other entries that share the same value of a field. I'm not bothered about fancy db stuff, just some foreach and array action will make me happy. Thanks very much in advance, my PHP has become horribly rusty and dusty --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake CPU hungry
For xdebug please read this pdf http://derickrethans.nl/files/phparch-xdebug-qa.pdf link from http://www.sitepoint.com/blogs/2006/04/20/php-frontend-for-xdebug-profiling/ Use linux and KCacheGrind. For windows:dwnload xdebug dll, and put in php/ext folder php.ini add: zend_extension_ts=C:\AppServ\php5\ext\php_xdebug.dll xdebug.auto_trace=1 xdebug.auto_profile=1 xdebug.auto_profile_mode=0 ;config ;xdebug.remote_enable=on ;xdebug.profiler_enable_trigger=on ;xdebug.profiler_output_dir=C:\AppServ\www ;xdebug.profiler_output_name=timestamp ;xdebug.profiler_enable=on There is KCacheGrind-wannabe for Windows - WinCacheGrind, for processing output. It's old (2005) software... $persistModel will cache constructed models and it's recursive associations Your app can work without mod_rewrite. Using mod_rewrite, apache seek .htaccess file in each directory in path ( from root ). @majna yeah.. I was planning to use xdebug, could you maybe provide any links on how to set it up properly ? I'll take a look at var $persistModel, debug is 0. As I already noticed var $uses is a point to optimize. What do you mean by : do not use mod_rewrite ? Cake url's are based on mod_rewrite. Thanks, Andrzej --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: problems with midphase hosting
I have had similar problems on a couple of hosts, it has to do with their apache setup so that the rules in the cake htacess files don't work Can you straight to your index.php file in Cake? On Aug 31, 4:43 pm, Alvaro [EMAIL PROTECTED] wrote: Hello, I am trying to get working my cakeph application in midphase hosting, doing the same thing I do for others hostings but can't make it work, I get a 404 error. Anywone has experience in this hosting? Thanks Alvaro --~--~-~--~~~---~--~~ 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 resources
On Aug 30, 4:17 am, Gwoo [EMAIL PROTECTED] wrote: Im happy to see you found my OCPHP presentation. I tried to sum up most of the features for 1.2, but the presentation was already 2 hours long, so I left some things out. Great article. Thanks for putting it together. It may find its way to the cakephp.org homepage soon. Is the reverse routing is that one I asked http://groups.google.com/group/cake-php/msg/19de513d90e54bc7 . If so, it doesn't work for me yet with trunk version. -- ?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: Cake CPU hungry
@majna thanks for the links. I just tried $persistModel and, at first page render I was extremely happy to see all the models cached but then when I refreshed I got this : Warning (2): Invalid argument supplied for foreach() [CORE\cake\libs \object.php, line 239] Object::__openPersistent() - CORE\cake\libs\object.php, line 239 Object::_persist() - CORE\cake\libs\object.php, line 203 Controller::constructClasses() - CORE\cake\libs\controller \controller.php, line 409 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 295 [main] - APP\webroot\index.php, line 81 and I could probably live with it .. but that was not enough.. I also saw : Fatal error: Model::findAll() [a href='http://php.net/function.Model- findAll'function.Model-findAll/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;SlugBehaviorquot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in G: \wamp\libs\cake\cake\libs\model\model.php on line 1432 that was it for $persistModel.. it happens to all behaviors.. I still didn't get deeper into this one, any thoughts ? Your app can work without mod_rewrite. Using mod_rewrite, apache seek .htaccess file in each directory in path ( from root ). I'm using lighttpd which is having all the rewrites in .conf file, more like httpd.conf then .htaccess... and I like friendly urls too much to not use rewrites ;) Best, Andrzej --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake CPU hungry
This persistModel tip was for cake 1.1.x and it works well. 1.2 has problem with behaviours and persistModel. Report ticket? mod_rewrite is a must have, I know :) On Sep 1, 9:37 pm, thequietlab [EMAIL PROTECTED] wrote: @majna thanks for the links. I just tried $persistModel and, at first page render I was extremely happy to see all the models cached but then when I refreshed I got this : Warning (2): Invalid argument supplied for foreach() [CORE\cake\libs \object.php, line 239] Object::__openPersistent() - CORE\cake\libs\object.php, line 239 Object::_persist() - CORE\cake\libs\object.php, line 203 Controller::constructClasses() - CORE\cake\libs\controller \controller.php, line 409 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 295 [main] - APP\webroot\index.php, line 81 and I could probably live with it .. but that was not enough.. I also saw : Fatal error: Model::findAll() [a href='http://php.net/function.Model- findAll'function.Model-findAll/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;SlugBehaviorquot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in G: \wamp\libs\cake\cake\libs\model\model.php on line 1432 that was it for $persistModel.. it happens to all behaviors.. I still didn't get deeper into this one, any thoughts ? Your app can work without mod_rewrite. Using mod_rewrite, apache seek .htaccess file in each directory in path ( from root ). I'm using lighttpd which is having all the rewrites in .conf file, more like httpd.conf then .htaccess... and I like friendly urls too much to not use rewrites ;) Best, Andrzej --~--~-~--~~~---~--~~ 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: outputting results from a db in groups of common content
Just yesturday I was wantiong a good solution to this same type of situation. Not wanting to filter / order etc in my views I quickly whipped up a small find funtcion implemented in my app_model. I'm sure there is possiobly a better implementation of this, but for now it is what it is. I figured the grouping in most of my cases was pretty simple, so for now this will do the trick, keeping my grouping logic out of my views / controllers. http://dark-code.bulix.org/9ofr62-54251 This would in your case return results like this: Array( [Print] = Array( [0] = Array( [Work] = Array( [id] = 1 [name] = piece of work 1 [type] = Print [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) ) [1] = Array( [Work] = Array( [id] = 2 [name] = piece of work 2 [type] = Print [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) ) ) [Digital] = Array( [0] = Array( [Work] = Array( [id] = 3 [name] = piece of work 3 [type] = Digital [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) ) [1] = Array( [Work] = Array( [id] = 4 [name] = piece of work 4 [type] = Digital [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) ) ) ) Hope that's of some help. Paul. -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoff Ford Sent: Saturday, 1 September 2007 11:53 p.m. To: Cake PHP Subject: Re: outputting results from a db in groups of common content Use an order by of type, name as the third option in the findAll() Then in your view you can do something like $current = ; foreach ($work in $works){ if ($work['Work']['type'] != $current) { // print heading } // print name and other details } Geoff -- http://lemoncake.wordpress.com On Sep 1, 10:10 am, GunitMail [EMAIL PROTECTED] wrote: Hello! Ok here is how an entry in my database looks like: [Work] = Array ( [id] = 1 [name] = piece of work 1 [type] = Print [date] = 2006-03-02 [description] = blah blah [content] = marqueeWORK!/marquee ) How would I go about getting cakePHP to output these on a page like: h2Print/h2 + piece of work 1 + piece of work 2 + piece of work 4 + piece of work 6 h2Digital/h2 + piece of work 3 + piece of work 5 So they are grouped together with other entries that share the same value of a field. I'm not bothered about fancy db stuff, just some foreach and array action will make me happy. Thanks very much in advance, my PHP has become horribly rusty and dusty __ NOD32 2497 (20070901) Information __ This message was checked by NOD32 antivirus system. http://www.eset.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 -~--~~~~--~~--~--~---
Newbie: Insert in many models from one controller
Hi bakers, First, sorry for this newbie question, and second, sorry for my poor English ;) I am attempting to insert from a ONE controller data in TWO different models. For instance (that is not what i am actually doing, but that is for sake of simplicity): I got from my form in a view a MIN value and MAX value, let us say 1 and 10. In my controller minmaxs_controller, i do a $this-Minmax-save($this- data); Ok, thats works (just begin to love cakePHP...) but just after at the same time, i want in the delta table (with my Delta model) insert all the values between this MIN value and the MAX value so first i create a loop to insert in an array all the possible values like this: for($i=$this-data['MinMax']['Min']; $i $this-data['MinMax']['Man']; $i++){ array_push($deltaArray, $i); } so now i have my array, and i wish to insert all these data in another table called Delta So i have first to instance a new Delta Model object in my MinMax controller: $this-Delta = new Delta(); and make again a loop to insert my data foreach ($deltaArray as $value) { $this-Delta-save($value); } OK, so everything is working, but... i am like feeling not satisfied by this solution, i am sure it is not elegant and there is probably a more elegant way of doing for two reasons: 1 - First, i instance another Model (Delta) in a MinMax controller, and it is confusing and will in the future probably be difficult to debug 2 - Second, i have to make a loop to insert the array in my model Delta, maybe CakePHP has kinds of helpers to insert directly a bunch of values directly and will create all the necessaries needed INSERT. Thank you very much for your valuable answers. Greg. --~--~-~--~~~---~--~~ 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: Insert in many models from one controller
Well, if you always want the Delta table to reflect your MinMax models, then perform the update the Delta table in the MinMax afterSave function. This way it will happen transparently from your controller - just save the MinMax model and the Delta table is automatically correct. But you can't really avoid the loop, as for each row CakePHP checks whether it is an insert/update, and this only supports one row at a time. There is updateAll(), but probably not what you want. In our application where we may need to insert/update several thousand rows at once I just did some custom SQL in a query() call. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cake 1.2 (latest alpha) persistModel + behavior = Fatal error ?
Hi, I'm getting this error while refreshing the site after models are cached. It happens for all behaviors. Any thoughts ? Fatal error: Model::findAll() [a href='http://php.net/function.Model- findAll'function.Model-findAll/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;SlugBehaviorquot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in G: \wamp\libs\cake\cake\libs\model\model.php on line 1363 Thanks, Andrzej --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
UnitConversion, in which layer? / Correct input erros, where?
Hi, I've got a Frames Model. Every frame has a (double) width and a (double) height. The standard unit for the values is centimeter. A User has chosen that he/she prefers: inches for fields where a length-value is required I'm doing conversion from the standard unit (centimeters) to the unit preferred by the user every time when I'm getting data from the Model through the controller into the view AND vice versa when I get input data from the user before saving it into the table. 1. In which layer should I do the conversion? I thought it should be placed within the model in beforeSave() / beforeValidate() and afterFind(). But conversion is not that easy (maybe in this particular case) and I really would like to have something like complex UnitConversionComponent but using components make no sense in a model at all... 2. Where can I correct input errors? If a user types 87EUR which is invalid and only EUR 82.2 would be valid. Where can I correct the mistake? I know that I can do it in beforeValidate() ...but how can I send the now valid value EUR 82.2 back to the view (if there were more invalid values that couldnt be corrected) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
confused where to place functions
hi i have a module controller. the situation is that i want that whenever a new module is added i will also create a new review and a new membership. Now where should i place the 2 functions needed to create a review and membership? Should i place them in the module controller or in the review controller and membership controller, or in the models? Sorry but im a bit confused about this and need some guidance 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: confused where to place functions
If functionality can be put in Models, it should. Code in controllers should only be what responds and parses the user request - then it should execute code stored in models and components. On Sep 2, 10:23 am, rtanz [EMAIL PROTECTED] wrote: hi i have a module controller. the situation is that i want that whenever a new module is added i will also create a new review and a new membership. Now where should i place the 2 functions needed to create a review and membership? Should i place them in the module controller or in the review controller and membership controller, or in the models? Sorry but im a bit confused about this and need some guidance 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: Adding disabled property to option tags in select
Would be nice to have a disabled option though disabled tag does not work in IE :( --~--~-~--~~~---~--~~ 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: Fw: cakephp Eclipse install where is console???
I have watched the video and followed the instructions. I can't see where console is located in cakephp Jim - Original Message - From: Chris Hartjes [EMAIL PROTECTED] To: cake-php@googlegroups.com Sent: Friday, August 31, 2007 7:48 PM Subject: Re: Fw: cakephp Eclipse install where is console??? On 8/31/07, SIXS [EMAIL PROTECTED] wrote: Hi, I a trying to install cakephp in Eclipse and when I get to showing where console is located I can't find it. I created a cakephp and looked for console I couldn't find it!. I am on win XP Pro, and Vertrigo(apache, php, mysql, etc). Thanks for any help. Jim Go watch this screencast which shows you how to set up the console on Windows: http://www.cakephp.org/screencasts/view/7 Hope that helps. -- 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: UnitConversion, in which layer? / Correct input erros, where?
erros ha! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
pagination with association... how?
For example, I have Publisher and Book with one to many association ( eg one Publisher has many books associated ). If I want to list all books with pagination, I can do this in the Controller $this-Pagination-resultsPerPage = array(); $this-Pagination-show = 25; $conditions = null; list($order, $limit, $page) = $this-Pagination-init($conditions,null, (array('sortBy'='name')); $data = $this-Book-findAll($conditions, NULL, $order, $limit,$page); $this-set('data',$data) but want if I want to view all the books that is associated with one of the Publisher? for example the one view, I would like to display the Publisher's name, then all the books that are associated with that publisher but with pagination? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---