Re: problema com session
está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
ja fiz varias vezes, mas vou fazer novamente.. valew ae! =) Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Então é inexplicável rs... para o 1.2 eu ouvi uns assuntos que session estava com alguns bugs. Debuga seu código e verifica o que acontece quando a sessão se perde. Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: não, estou usando 1.1~ =/ Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
então, somente alterei a CAKE_SECURITY de high para low e a sessão não se perde mais.. o0 mas valew ae! =) Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: ja fiz varias vezes, mas vou fazer novamente.. valew ae! =) Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Então é inexplicável rs... para o 1.2 eu ouvi uns assuntos que session estava com alguns bugs. Debuga seu código e verifica o que acontece quando a sessão se perde. Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: não, estou usando 1.1~ =/ Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
seu favicon.ico está no lugar certo ? confere, aí. alguns problemas de sessão vêm daí. (é estranho, mas tem a ver com o primeiro request sempre ser duplo (página e icone), timeout do request do servidor, firefox agindo de maneira errada, etc). spark 2008/2/14 Formigao TTS [EMAIL PROTECTED]: ja fiz varias vezes, mas vou fazer novamente.. valew ae! =) Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Então é inexplicável rs... para o 1.2 eu ouvi uns assuntos que session estava com alguns bugs. Debuga seu código e verifica o que acontece quando a sessão se perde. Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: não, estou usando 1.1~ =/ Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
nao estou usando favicon mas resolvi alterando a security para low =) Em 14/02/08, DJ Spark [EMAIL PROTECTED] escreveu: seu favicon.ico está no lugar certo ? confere, aí. alguns problemas de sessão vêm daí. (é estranho, mas tem a ver com o primeiro request sempre ser duplo (página e icone), timeout do request do servidor, firefox agindo de maneira errada, etc). spark 2008/2/14 Formigao TTS [EMAIL PROTECTED]: ja fiz varias vezes, mas vou fazer novamente.. valew ae! =) Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Então é inexplicável rs... para o 1.2 eu ouvi uns assuntos que session estava com alguns bugs. Debuga seu código e verifica o que acontece quando a sessão se perde. Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: não, estou usando 1.1~ =/ Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Timeout
Ptz!!! Funcionou! Muitíssimo obrigado Juan e [EMAIL PROTECTED] att. Siscoj WEB On 2/13/08, Juan Basso [EMAIL PROTECTED] wrote: Se o safe_mode estiver off, você pode usar o set_time_limit(0). Isso faz com que ignore o tempo, ou seja, equivalente a colocar no php.ini oo max_execution_time=0. Juan Basso On 13 fev, 17:02, [8)][][][][:o][][/)] [EMAIL PROTECTED] wrote: se você puder alterar o php.net, é só modificar alguma dessas linhas: ;;; ; Resource Limits ; ;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) Talvez aumentando o memory_limit e o max_execution_time você consiga executar o script. Em 13/02/08, Desenvolvimento SiscoJ [EMAIL PROTECTED] escreveu: Caros, sei q a lista é especifica de CAKE, mas, se alguma bendita alma ja passou por isso, gostaria de uma luz. Tenho um sistema de workflow e, no final do projeto preciso entregar um mapa dos processos para o cliente. Optei por fazer uma saida em XLS. Até ae tudo bem, mas o problema é que as consultas sao muito complexas e grandes, acaba q dá time out e o server nao entrega o XLS. Existe algo q possa fazer para aumentar esse tempo, nao nao vai ter jeito, vou ter q fazer isso Offline e entregar para o cliente? grato Siscoj WEB- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Chamar o validacao no controller?
Tenta $this-Model-validates() na 1.2 é assim, ele retorna true se validar ou um array de errors se não validar. Na 1.1 eu não lembro mais como que faz =/ 2008/2/14 etapombas [EMAIL PROTECTED]: Antes de executar o $this- Model - save() o próprio cake valida todos os campos. (isso todo mundo esta careca de saber), mas eu gostaria chamar essa validação manualmente pois não vou gravar nada, apenas quero verificar se todos os campos foram preenchidos corretamente como esta no model. Estou usando a versão 1.1.x -- Rafael Barbosa Analista de Sistemas Web Gradua Networks --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Chamar o validacao no controller?
Antes de executar o $this- Model - save() o próprio cake valida todos os campos. (isso todo mundo esta careca de saber), mas eu gostaria chamar essa validação manualmente pois não vou gravar nada, apenas quero verificar se todos os campos foram preenchidos corretamente como esta no model. Estou usando a versão 1.1.x --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: API Google Maps
Olá pessoal, Bom, deixa eu atualizar as informações que tenho, assim vocês vão poder me ajudar melhor e, no futuro protegerem-se desse problema. Como havia comentado, o problema ocorre em operas anteriores ou iguais ao 9.25 (acho que é a maioria da base instalada -- incluindo o Opera do Nintendo Wii e dos celulares J2me que também têm problemas). Ontem a noite comecei vários testes. Substituí meu *layout* map.ctp por um conteúdo padrão Google (sugerido na página das APIs). Usei o Nintendo Wii como benchmark (o browser do Wii é provido pelo Opera). Claro, essa mudança radical funcionou pois, não usava nada do cake, nem das minhas *views*. Usando esse modelo do google, acrescentei apenas um: ?php echo $content_for_layout;? E imediatamente não funcionou mais (no Opera do Wii), no Firefox e IE tudo beleza como antes. Opa, então o problema estava, ou no *helper* ou na view plotter.ctp. Isso eliminou problemas no *layout* map.ctp. Então fui na *view * plotter.ctp e comecei a enxugar tudo. Eu tinha dois DIVs dentro dessa view, um iria conter o mapa e outro conteria campos. Matei ambos, deixei só o *helper* trabalhando e bingo. Funcionou no Wii, FF e IE. Deduzi então que fosse problema com DIV e fui googlear. Descobri problemas muito antigos com DIV mas nenhum cabia no meu caso. De qualquer forma abri o *helper *e verifiquei que seu autor, Mahmoud Lababidi, usou o objeto GMap e não o GMap2 que, segundo o Google, possui mais funcionalidades (e, certamente mais *bugfixes*). Fiz algumas alterações no *helper* para acomdar o GMap2 e suas incompatibilidades com o GMap. Tudo funcionou glorioso no Wii, FF e IE. Até uns problemas de *loading* que, as vezes, aconteciam no IE (6 e 7) sumiram. ÓTIMO! Voltei os DIV que haviam na *view* plotter.ctp. Claro, não funcionou mais no Wii. Pesquisei, pesquisei e não achei nada. Tentei algumas dicas de compatibilidade, até que decidi: dá para conviver sem esses dois DIV! Tirei os DIV e tudo voltou a funcionar. Voltei então para o map.ctp (*layout*) afim de restaurá-lo para os padrões do *site*. Coloquei cabeçalho com título, CSS e demais variáveis do cake. Voltei a chamar as APIs do google através do *helper* Javascript e pau! Parou de funcionar. Nesse momento senti uma vontade grande de xingar alguém hihihi. Respirei fundo e notei que, no layout do cake (no qual estou baseado), a seguinte estrutura de DIVs: div container div header div content for layout div footer logs de debug Claro que os nomes não são estes... Por sua vez, o div que acomodar o $content_for_layout se desdobra em: div canvas div map div texto/campos Como eu disse, retirei os DIV canvas e texto/campos (os nomes não são estes, é só para fazer alusão ao conteúdo) ficando apenas com o div map que é criado pelo *helper* para acomodar o mapa (dentro dele o google enfia um zilhão de outros div). Então, a estrutura completa fica: div container div header div content for layout div map div footer logs de debug Isso já após retirar os DIV que estavam dando problema. Notei então que, no *layout* parecido com o cake, o div map fica dentro de outros dois div. Testei apagando o div container e o div content for* layout*. Ou seja, o div map reside diretamente no body da página. Voltou a funcionar no Opera do Wii, só que a página perde um pouco da identidade visual, principalmente, o mapa agora flutua sobre o debug, coisas estranhas acontecem as vezes. Mas já é um *workaround* temporariamente aceitável. Então, o problema está nos DIV, um dentro do outro. Parece que o Opera tem dificuldades com isso. Porém, nas minhas mexidas, não detectei o que, mas parece que esse defeito está relacionado ao estilo do DIV pois com o div map dentro do div content for layout eu consegui, mais ou menos, visualizar um mapa no Wii depois de matar vários CSS. Porém, mesmo assim com alguns problemas. Alguém sabe algo sobre esse problema? Bom, na minha busca por uma solução acabei tropeçando e algo mais sujo e que não sei explicar. Em nenhum momento o Google Maps deu pau (a ponto de não abrir o mapa e abrir apenas os controles) no FF e no IE, mas, ao tentar deixar o layout próximo do recomendado pelo Google, coloquei a linha DOCTYPE que estava faltando. Pronto, não funcionou em nenhum browser mais. Usei a XHTML strict e transitional mas com essas linhas tenho problemas em todos os browser. Exemplo: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; Retirando tal linha do map.ctp (*layout*) tudo volta a funcionar. Resolvi então validar o documento no w3c. Colocando o DOCType recebo 100% * compliance* (fiz alterações para chegar nisso), sem a linha recebo 100% * compliance* com aviso de que o doctype não foi definido explicitamente. Mesmo estando 100% *compliance* o FF, IE e Opera dão pau, tirando a linha doctype (e continuando *compliance* mas com ressalva) funciona no FF e no IE mas não no Opera. Isso me fez pensar se não tem algum outro problema que
Re: Canal IRC
Aproveitando o assunto. Meu problema é o seguinte: Tenho um método no meu MODEL, onde: 1) Através da conexão default, crio um novo banco de dados (o nome do banco de dados é passado dinâmicamente para o meu método); 2) Atribuo privilégios para um usuário, que também é recebido pelo método do meu MODEL. 3) Preciso criar (com os parâmetros recebidos pelo método) uma nova conexão na classe DATABASE_CONFIG, ou pelo menos passar os parâmetros de conexão (host, login, password, database); 4) Tornar essa conexão default; ou setá-la em $this- useDbConfig; 5) Executar instruções no banco de dados, através dessa conexão. Enfim, é isso. Obrigado. Paulo. On 29 jan, 12:35, Tulio Faria [EMAIL PROTECTED] wrote: tou lá :) On 28 Jan, 14:13, Gustavo Carreno [EMAIL PROTECTED] wrote: Eu uso o X-Chat tanto para windows como para Linux. A versão de windows, infelismente, é paga mas a de Linux continua de borla. Existem outros cliente de IRC não comerciais que são até bastante bons, mas existem alguns buracos neles que nem sempre são patchados. Vcs escolham. existem sempre a linha de comando e o irssi, LOL!! Não sei se tem essa versão no cygwin mas posso investigar. 2008/1/28 Eber Freitas Dias [EMAIL PROTECTED]: eu uso o ChatZilla, uma extensão do Firefox que me permite conectar ao IRC... acho mto facil e bacana de usar, prefiro ele aomIRC... 2008/1/28 Juan Basso [EMAIL PROTECTED]: Não. É que tem poucos que acessam ainda hehehe Bill: de dentro domirc, você escuta o seguinte: /server irc.freenode.net Vai aparecer um monte de texto (conectando no servidor e mensagens)... Depois disso, você digita: /join #cakephp /join #cakephp-pt Pronto, você vai estar nos canais do cake ;) Quanto ao trial, as versões antigas expiravam, mas não bloqueavam o uso. Estas mais novas eu não sei. Juan Basso On 28 jan, 12:32, Defranco [EMAIL PROTECTED] wrote: Eu entrei no servidor irc.freenode.net e achei o #cakephp com 150 pessoas no momento, mas o canal #cakephp-pt está vazio. Estou no lugar errado? -- Gustavo Carreno ---http://batxman.wordpress.com If you know Red Hat you know Red Hat, If you know Slackware you know Linux - Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Chamar o validacao no controller?
Orra. eu li, re-li o api do cake e não vi essa função!! Funcionou perfeito Valeu cara On 14 fev, 14:42, Rafael Barbosa [EMAIL PROTECTED] wrote: Tenta $this-Model-validates() na 1.2 é assim, ele retorna true se validar ou um array de errors se não validar. Na 1.1 eu não lembro mais como que faz =/ 2008/2/14 etapombas [EMAIL PROTECTED]: Antes de executar o $this- Model - save() o próprio cake valida todos os campos. (isso todo mundo esta careca de saber), mas eu gostaria chamar essa validação manualmente pois não vou gravar nada, apenas quero verificar se todos os campos foram preenchidos corretamente como esta no model. Estou usando a versão 1.1.x -- Rafael Barbosa Analista de Sistemas Web Gradua Networks --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Sugestão: Mais vida ao $this - flash()
Galera eu uso o $this - flash pra tudo: confirmar cadastros, negar acesso e notificar erros. Fiz algumas alterações no core do cake e gostaria de compartilhar com vocês. Primeiro vamos alterar o controlador do core: /cake/cake/libs/ controller/controller.php A única coisa que fiz, foi adicionar a variavel $style linha: 618 function flash($message, $url, $pause = 1, $style = null) { $this-autoRender = false; $this-autoLayout = false; $this-set('url', $this-base . $url); $this-set('message', $message); $this-set('pause', $pause); $this-set('page_title', $message); $this-set('style', $style); if (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) { $flash = VIEWS . 'layouts' . DS . 'flash.thtml'; } elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . layouts . DS . 'flash.thtml')) { } $this-render(null, false, $flash); } ## Agora vamos mudar o layout: /cake/cake/libs/view/templates/layouts/ flash.thtml !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head title?php echo $page_title; ?/title ?php echo $html-charset(); ? ?php if (Configure::read() == 2) { ? meta http-equiv=Refresh content=?php echo $pause; ?;url=?php echo $url; ?/ ?php } ? style !-- body { background: #fff; /* padding-top: 15%; */ } p { text-align:center; font:bold 1.1em sans-serif } a { text-decoration: none; } a:hover { text-decoration: underline; } /* # Messages # */ .error, .notice, .success{ padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } .error { background: #FBE3E4; color: #D12F19; border-color: #FBC2C4; } .notice { background: #FFF6BF; color: #817134; border-color: #FFD324; } .success{ background: #E6EFC2; color: #529214; border-color: #C6D880; } .error a{ color: #D12F19; } .notice a { color: #817134; } .success a { color: #529214; } -- /style /head body p ? if ($style) { echo 'class='.$style.''; } ? a href=?php echo $url; ??php echo $message; ?/abr / a href=?php echo $url; ?span style=font-size:10px;(clique aqui para continuar)/span/a /p /body /html ## Pronto, agora toda vez que você for chamar o flash dentro dos seus controladores faça da seguinte maneira $this - flash('Mensagem', 'link', NULL, 'success'); $this - flash('Mensagem', 'link', NULL, 'notice'); $this - flash('Mensagem', 'link', NULL, error'); por favor comentem --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Sugestão: Mais vida ao $this - flash()
a principio parece legal, pq não modificou nada na estrutura, parece um hack bem interessante, vou testar agora mesmo e ja comento :D Abraços e até + Bill www.cakephp.com.br Galera eu uso o $this - flash pra tudo: confirmar cadastros, negar acesso e notificar erros. Fiz algumas alterações no core do cake e gostaria de compartilhar com vocês. Primeiro vamos alterar o controlador do core: /cake/cake/libs/ controller/controller.php A única coisa que fiz, foi adicionar a variavel $style linha: 618 function flash($message, $url, $pause = 1, $style = null) { $this- autoRender = false; $this-autoLayout = false; $this-set('url', $this-base . $url); $this-set('message', $message); $this- set('pause', $pause); $this-set('page_title', $message); $this- set('style', $style); if (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) { $flash = VIEWS . 'layouts' . DS . 'flash.thtml'; } elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . layouts . DS . 'flash.thtml')) { } $this-render(null, false, $flash); } ## Agora vamos mudar o layout: /cake/cake/libs/view/templates/layouts/ flash.thtml http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd xmlns=http://www.w3.org/1999/xhtml; $page_title; ? charset(); ? ?php echo $pause; ?;url= echo $url; ?/ href= href=(clique aqui para continuar) ## Pronto, agora toda vez que você for chamar o flash dentro dos seus controladores faça da seguinte maneira $this - flash('Mensagem', 'link', NULL, 'success'); $this - flash('Mensagem', 'link', NULL, 'notice'); $this - flash('Mensagem', 'link', NULL, error'); por favor comentem --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
DATABASE CONFIG dinâmico ...
Meu problema é o seguinte: Tenho um método no meu MODEL, onde: 1) Através da conexão default, crio um novo banco de dados (o nome do banco de dados é passado dinâmicamente para o meu método); 2) Atribuo privilégios para um usuário, que também é recebido pelo método do meu MODEL. 3) Preciso criar (com os parâmetros recebidos pelo método) uma nova conexão na classe DATABASE_CONFIG, ou pelo menos passar os parâmetros de conexão (host, login, password, database); 4) Tornar essa conexão default; ou setá-la em $this- useDbConfig; 5) Executar instruções no banco de dados, através dessa conexão. Enfim, é isso. Se alguém puder me ajudar, agradeço. Paulo Augusto M. Pereira. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Sugestão: Mais vida ao $this - flash()
Eu não pessoalmente não sou muito a favor de alterar o core do cake, ainda mais de um framework que está em desenvolvimento continuo. Acredito que é mais adequado sobrescrever o método no seu app_controller.php. Minha sugestão apenas, pois assim você pode dar um update no core do cake e não se preocupar em ficar refazendo isso a todo momento. Abraços, Marcio Trindade On Feb 14, 5:56 pm, etapombas [EMAIL PROTECTED] wrote: Galera eu uso o $this - flash pra tudo: confirmar cadastros, negar acesso e notificar erros. Fiz algumas alterações no core do cake e gostaria de compartilhar com vocês. Primeiro vamos alterar o controlador do core: /cake/cake/libs/ controller/controller.php A única coisa que fiz, foi adicionar a variavel $style linha: 618 function flash($message, $url, $pause = 1, $style = null) { $this-autoRender = false; $this-autoLayout = false; $this-set('url', $this-base . $url); $this-set('message', $message); $this-set('pause', $pause); $this-set('page_title', $message); $this-set('style', $style); if (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) { $flash = VIEWS . 'layouts' . DS . 'flash.thtml'; } elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . layouts . DS . 'flash.thtml')) { } $this-render(null, false, $flash); } ## Agora vamos mudar o layout: /cake/cake/libs/view/templates/layouts/ flash.thtml !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head title?php echo $page_title; ?/title ?php echo $html-charset(); ? ?php if (Configure::read() == 2) { ? meta http-equiv=Refresh content=?php echo $pause; ?;url=?php echo $url; ?/ ?php } ? style !-- body { background: #fff; /* padding-top: 15%; */ } p { text-align:center; font:bold 1.1em sans-serif } a { text-decoration: none; } a:hover { text-decoration: underline; } /* # Messages # */ .error, .notice, .success{ padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } .error { background: #FBE3E4; color: #D12F19; border-color: #FBC2C4; } .notice { background: #FFF6BF; color: #817134; border-color: #FFD324; } .success{ background: #E6EFC2; color: #529214; border-color: #C6D880; } .error a{ color: #D12F19; } .notice a { color: #817134; } .success a { color: #529214; } -- /style /head body p ? if ($style) { echo 'class='.$style.''; } ? a href=?php echo $url; ??php echo $message; ?/abr / a href=?php echo $url; ?span style=font-size:10px;(clique aqui para continuar)/span/a /p /body /html ## Pronto, agora toda vez que você for chamar o flash dentro dos seus controladores faça da seguinte maneira $this - flash('Mensagem', 'link', NULL, 'success'); $this - flash('Mensagem', 'link', NULL, 'notice'); $this - flash('Mensagem', 'link', NULL, error'); por favor comentem --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Sugestão: Mais vida ao $this - flash()
Somente para relembrar (é realmente esqueci), como é que se sobrescreve um método? Aproveitando ainda mais... Como eu faço pra chamar este método em todas as requisições de páginas? Falopa! Em 14/02/08, Marcio Trindade [EMAIL PROTECTED] escreveu: Eu não pessoalmente não sou muito a favor de alterar o core do cake, ainda mais de um framework que está em desenvolvimento continuo. Acredito que é mais adequado sobrescrever o método no seu app_controller.php. Minha sugestão apenas, pois assim você pode dar um update no core do cake e não se preocupar em ficar refazendo isso a todo momento. Abraços, Marcio Trindade On Feb 14, 5:56 pm, etapombas [EMAIL PROTECTED] wrote: Galera eu uso o $this - flash pra tudo: confirmar cadastros, negar acesso e notificar erros. Fiz algumas alterações no core do cake e gostaria de compartilhar com vocês. Primeiro vamos alterar o controlador do core: /cake/cake/libs/ controller/controller.php A única coisa que fiz, foi adicionar a variavel $style linha: 618 function flash($message, $url, $pause = 1, $style = null) { $this-autoRender = false; $this-autoLayout = false; $this-set('url', $this-base . $url); $this-set('message', $message); $this-set('pause', $pause); $this-set('page_title', $message); $this-set('style', $style); if (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) { $flash = VIEWS . 'layouts' . DS . 'flash.thtml'; } elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . layouts . DS . 'flash.thtml')) { } $this-render(null, false, $flash); } ## Agora vamos mudar o layout: /cake/cake/libs/view/templates/layouts/ flash.thtml !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head title?php echo $page_title; ?/title ?php echo $html-charset(); ? ?php if (Configure::read() == 2) { ? meta http-equiv=Refresh content=?php echo $pause; ?;url=?php echo $url; ?/ ?php } ? style !-- body { background: #fff; /* padding-top: 15%; */ } p { text-align:center; font:bold 1.1em sans-serif } a { text-decoration: none; } a:hover { text-decoration: underline; } /* # Messages # */ .error, .notice, .success{ padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } .error { background: #FBE3E4; color: #D12F19; border-color: #FBC2C4; } .notice { background: #FFF6BF; color: #817134; border-color: #FFD324; } .success{ background: #E6EFC2; color: #529214; border-color: #C6D880; } .error a{ color: #D12F19; } .notice a { color: #817134; } .success a { color: #529214; } -- /style /head body p ? if ($style) { echo 'class='.$style.''; } ? a href=?php echo $url; ??php echo $message; ?/abr / a href=?php echo $url; ?span style=font-size:10px;(clique aqui para continuar)/span/a /p /body /html ## Pronto, agora toda vez que você for chamar o flash dentro dos seus controladores faça da seguinte maneira $this - flash('Mensagem', 'link', NULL, 'success'); $this - flash('Mensagem', 'link', NULL, 'notice'); $this - flash('Mensagem', 'link', NULL, error'); por favor comentem --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Chamar o validacao no controller?
lancaram ha menos de 1 semana: http://book.cakephp.org/ vai dar conta da parte pratica do cake. já é muito muito muito útil spark 2008/2/14 Rafael Barbosa [EMAIL PROTECTED]: O grande defeito do cake é a falta de documentação. Quando li a sua dúvida eu dei checkout no repositório svn deles, abri o arquivo /cake/libs/model/model.php e procurei a função. Isso hoje é mais rapido que consultar a api deles, infelizmente. Torço para que agora, com os devs empolgados com a CakeFest, as coisas devem andar bem rápido por algum tempo =P 2008/2/14 etapombas [EMAIL PROTECTED]: Orra. eu li, re-li o api do cake e não vi essa função!! Funcionou perfeito Valeu cara On 14 fev, 14:42, Rafael Barbosa [EMAIL PROTECTED] wrote: Tenta $this-Model-validates() na 1.2 é assim, ele retorna true se validar ou um array de errors se não validar. Na 1.1 eu não lembro mais como que faz =/ 2008/2/14 etapombas [EMAIL PROTECTED]: Antes de executar o $this- Model - save() o próprio cake valida todos os campos. (isso todo mundo esta careca de saber), mas eu gostaria chamar essa validação manualmente pois não vou gravar nada, apenas quero verificar se todos os campos foram preenchidos corretamente como esta no model. Estou usando a versão 1.1.x -- Rafael Barbosa Analista de Sistemas Web Gradua Networks -- Rafael Barbosa Analista de Sistemas Web Gradua Networks -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
autocomplete no cake 1.2
Bom galera como usar autocomplete no cake 1.2 obrigado morlocks --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
IDE para PHP
Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: problema com session
Eu também estava tendo este problema e mudando o security pra low aparentemente resolveu On 14 fev, 10:52, Formigao TTS [EMAIL PROTECTED] wrote: nao estou usando favicon mas resolvi alterando a security para low =) Em 14/02/08, DJ Spark [EMAIL PROTECTED] escreveu: seu favicon.ico está no lugar certo ? confere, aí. alguns problemas de sessão vêm daí. (é estranho, mas tem a ver com o primeiro request sempre ser duplo (página e icone), timeout do request do servidor, firefox agindo de maneira errada, etc). spark 2008/2/14 Formigao TTS [EMAIL PROTECTED]: ja fiz varias vezes, mas vou fazer novamente.. valew ae! =) Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Então é inexplicável rs... para o 1.2 eu ouvi uns assuntos que session estava com alguns bugs. Debuga seu código e verifica o que acontece quando a sessão se perde. Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: não, estou usando 1.1~ =/ Em 14/02/08, Henrique de Castro [EMAIL PROTECTED] escreveu: Isso já aconteceu comigo também, é no cake 1.2 não é?! Em 14/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: está default (120) seg, mas ele perde sessão em tempos variados. Em 13/02/08, Michael Mafort [EMAIL PROTECTED] escreveu: verifique no core o tempo de vida da sessão. Em 13/02/08, Formigao TTS [EMAIL PROTECTED] escreveu: seguinte, estou com problema de session, conforme vou navegando nas paginas ele perde a session e volta pra tela de login, procurei bastante e não encontrei nada que resolvesse meu problema, alguem ja teve este problema poderia me dar uma ajuda? Vinicios. -- [livesets]http://djspark.com.br/ [web]http://sydi.net [filmes]http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Cake 1.2
Bom, Gostaria de fazer uma coisa que nao sei se ja existe no cake... tenho uma pagina com varios checkbox gostaria que qnd marcar um desses checkbox seja executado um comndo add... mas sem que eu tenha que dar um submit.. alquem sabe se isso e possível ou se alguem ja fez obrigado t+ Morlocks --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
Gosto muito do Eclipse com PDT, tem tanto pra Win quanto pra Linux, e é livre.. Thiago 2008/2/14 Murdoc [EMAIL PROTECTED]: Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. -- Thiago Paes - www.thiagopaes.com.br - Linuxer: #224062 --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
acho eclipse pesado, um q uso a anos é o Editplus, um editor simples e muito bom. o notepad ++ tb é levinho e bom pra usar Gosto muito do Eclipse com PDT, tem tanto pra Win quanto pra Linux, e é livre.. Thiago 2008/2/14 Murdoc : Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
Boas pessoal. Eu uso o Gedit (em Ubuntu). Com plugins para ficar semelhante ao TextMate do Mac. E no OSX uso o textmate (que, na minha opinião, é o melhor editor de texto do mundo) Zen -- --~-- ~ ---~--- name: Ricardo Valfreixo MSN: [EMAIL PROTECTED] web: http://www.minimalisticstudios.com ~ --~-- ---~--- 2008/2/15 Bill [EMAIL PROTECTED]: acho eclipse pesado, um q uso a anos é o Editplus, um editor simples e muito bom. o notepad ++ tb é levinho e bom pra usar Gosto muito do Eclipse com PDT, tem tanto pra Win quanto pra Linux, e é livre.. Thiago 2008/2/14 Murdoc : Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
Olá, Também escolhi o Eclipse + PDT + tourtoise SVN. Abraço, Benito 2008/2/14 Bill [EMAIL PROTECTED]: acho eclipse pesado, um q uso a anos é o Editplus, um editor simples e muito bom. o notepad ++ tb é levinho e bom pra usar Gosto muito do Eclipse com PDT, tem tanto pra Win quanto pra Linux, e é livre.. Thiago 2008/2/14 Murdoc : Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. -- Josenivaldo Benito Junior. PU2LBD Organizador do Concurso Brasileiro de 144 MHZ - CB144 (em conj. com PY2BRZ e PY2HCD) http://www.gbvudx.qsl.br Assine a Lista de e-mails do GBVUDX: http://www.gbvudx.qsl.br/refletor_gbvudx.asp --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
Também sou novo aqui :) Uso o zend studio.. é um pouco pesado e não é free.. mas eu gosto.. O ecplise + pdt é ótimo também.. On 14 fev, 13:12, Murdoc [EMAIL PROTECTED] wrote: Olá pessoal acabei de entrar para o grupo e gostaria de saber qual a IDE vocês tem usado para desenvolver os projetos em php, eu uso o aptana com plugin para o php ele tem intelisense que é bem util e da um suporte bacana para css. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Sugestão: Mais vida ao $this - flash()
ei, manda esse patch num ticket, é ótimo ! spark 2008/2/14 etapombas [EMAIL PROTECTED]: Galera eu uso o $this - flash pra tudo: confirmar cadastros, negar acesso e notificar erros. Fiz algumas alterações no core do cake e gostaria de compartilhar com vocês. Primeiro vamos alterar o controlador do core: /cake/cake/libs/ controller/controller.php A única coisa que fiz, foi adicionar a variavel $style linha: 618 function flash($message, $url, $pause = 1, $style = null) { $this-autoRender = false; $this-autoLayout = false; $this-set('url', $this-base . $url); $this-set('message', $message); $this-set('pause', $pause); $this-set('page_title', $message); $this-set('style', $style); if (file_exists(VIEWS . 'layouts' . DS . 'flash.thtml')) { $flash = VIEWS . 'layouts' . DS . 'flash.thtml'; } elseif ($flash = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . layouts . DS . 'flash.thtml')) { } $this-render(null, false, $flash); } ## Agora vamos mudar o layout: /cake/cake/libs/view/templates/layouts/ flash.thtml !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head title?php echo $page_title; ?/title ?php echo $html-charset(); ? ?php if (Configure::read() == 2) { ? meta http-equiv=Refresh content=?php echo $pause; ?;url=?php echo $url; ?/ ?php } ? style !-- body { background: #fff; /* padding-top: 15%; */ } p { text-align:center; font:bold 1.1em sans-serif } a { text-decoration: none; } a:hover { text-decoration: underline; } /* # Messages # */ .error, .notice, .success{ padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; } .error { background: #FBE3E4; color: #D12F19; border-color: #FBC2C4; } .notice { background: #FFF6BF; color: #817134; border-color: #FFD324; } .success{ background: #E6EFC2; color: #529214; border-color: #C6D880; } .error a{ color: #D12F19; } .notice a { color: #817134; } .success a { color: #529214; } -- /style /head body p ? if ($style) { echo 'class='.$style.''; } ? a href=?php echo $url; ??php echo $message; ?/abr / a href=?php echo $url; ?span style=font-size:10px;(clique aqui para continuar)/span/a /p /body /html ## Pronto, agora toda vez que você for chamar o flash dentro dos seus controladores faça da seguinte maneira $this - flash('Mensagem', 'link', NULL, 'success'); $this - flash('Mensagem', 'link', NULL, 'notice'); $this - flash('Mensagem', 'link', NULL, error'); por favor comentem -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: IDE para PHP
Como o Bill e o Ricardo, prefiro editores de texto. Já trabalhei com algumas IDE's mas o textmate é a melhor invenção até agora para programar. No windows eu uso intype, apesar de estar ainda na versão alpha é a coisa mais parecida com textmate para windows. --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: can someone please explain to me what {n} is?
{n} is a placeholder for numbered keys in arrays. So this would translate into something like [1]['Role']['id'] [2]['Role']['id'] [3]['Role']['id'] . . . Check this page: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/ Felix explains how tho use Set::extract which also uses the {n} syntax HTH, Alex On Feb 14, 1:55 am, quoc [EMAIL PROTECTED] wrote: In the cake manual this is an example of the generateList function: $this-set( 'Roles', $this-Role-generateList(null, 'role_name ASC', null, '{n}.Role.id', '{n}.Role.role_name') ); I see this around a lot {n}.Role.id but I can't seem to figure out what the {n} means. I've been trying to search for it but I can't find anything on 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: master table has many detail tables( more than one)
$hasMany is given an array so you need to add another item to that array for the works assoc. in its simplest form it would be: array('Event','Work') This should work for you with all the possible options included. var $hasMany = array( 'Event' = array('className' = 'Event', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ), 'Work' = array('className' = 'Work', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); On Feb 14, 4:45 am, jvandal [EMAIL PROTECTED] wrote: Hi, I have a person table that has an many events table and also has many work tables one person has several events and also has several works . I can't get the code correct. == ?php class Person extends AppModel { var $name = 'Person'; var $useTable = 'people'; //The Associations below have been created with all possible keys, those that are not needed can be removed var $hasMany = array( 'Event' = array('className' = 'Event', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); } ? This the code generated for one has many event . Copied this code to have two has many work but I get an error. What is the correct code to also have the work table associated to the person table? Thanks for any help Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: master table has many detail tables( more than one)
Wow, google can really mess up the formatting. :) one more try: var $hasMany = array( 'Event' = array('className' = 'Event', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ), 'Work' = array('className' = 'Work', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); On Feb 14, 9:38 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: $hasMany is given an array so you need to add another item to that array for the works assoc. in its simplest form it would be: array('Event','Work') This should work for you with all the possible options included. var $hasMany = array( 'Event' = array('className' = 'Event', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ), 'Work' = array('className' = 'Work', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); On Feb 14, 4:45 am, jvandal [EMAIL PROTECTED] wrote: Hi, I have a person table that has an many events table and also has many work tables one person has several events and also has several works . I can't get the code correct. == ?php class Person extends AppModel { var $name = 'Person'; var $useTable = 'people'; //The Associations below have been created with all possible keys, those that are not needed can be removed var $hasMany = array( 'Event' = array('className' = 'Event', 'foreignKey' = 'person_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); } ? This the code generated for one has many event . Copied this code to have two has many work but I get an error. What is the correct code to also have the work table associated to the person table? Thanks for any help Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AppController methods in CakePHP 1.2
put die in __construct(){ die('wtf'); } On 13 velj, 21:43, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: can i jump in here? i have app_controller.php in controllers/ and its first line is die(woot) it does not die. i made a copy and put in the app root, and it did not die either. 1.2.0.6311 beta On Jan 30, 4:39 am, Seb [EMAIL PROTECTED] wrote: OK, now I'm confused. I've just got the latest nightly, put app_controller.php in /app/ app_controller.php and it seems to be working - looks like there's something broke in the new year's build?! Thanks for the help anyway - i'll pseudo protect my functions from now on :D Seb On Jan 30, 10:30 am, grigri [EMAIL PROTECTED] wrote: Since a certain revision of 1.2 (not sure which one), your app controller must be in /app/controllers/app_controller.php NOT /app/app_controller.php like before Also note that in a controller, any 'public' method is potentially an action, so you should really pseudo-protect `doSomething` : class AppController extends Controller { function _doSomething() { // ... } } On Jan 30, 10:17 am, Seb [EMAIL PROTECTED] wrote: I've looked into this a bit more and found that if i stick my custom functions for AppController in: /cake/libs/controller/app_controller.php Then the function is visible in the sub controllers - is Cake 1.2 just ignoring my /app/app_controller.php completely?! (also i tried putting it in /app/controllers/app_controller.php and that didn't work either...) Thanks! Seb On Jan 30, 10:07 am, Seb [EMAIL PROTECTED] wrote: Hi! I'm just thinking about moving an App i'm working on to CakePHP 1.2 so that I can enjoy some of the new features... I seem to have fallen at the first hurdle though! In my existing app (for 1.1) I define some functions in my /app/ app_controller.php for use elsewhere. E.g.: class AppController extends Controller { function isAdmin() { return isset($this-params['admin']); } } Then from my other controllers (which extend AppController), I can have things which call it: class SomeController extends AppController { function doSomething() { if ($this-isAdmin()) { // blah } } This works fine in 1.1, but causes a Call to undefined method SomeController::isAdmin() in CakePHP 1.2 I can't really think of a better way to do things like that without duplicating lots of code (which I do my best to avoid at all times) so would like a way to make the Controllers inherit function properly from their parent objects... Please help! Thanks Seb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Conditions on a hasMany query.
Hi. I have a hasMany association like this: Product - hasMany - Section I want to find _ALL_ of my products but only the associated sections with a condition (publicationday = 'date'). Do i need to use the bindModel and set the condition that way before i preform my findAll? Best Regards Laeffe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 problem, reading id passed in URL
Hi All, this is my first application using cakePHP so apologies if this is a bit basic. I was following the 15min blog tutorial and using it as the basis for my own application but I am getting an error when I try and pass through an ID to a function via the URL. e.g. http://localhost/nsg/testimonials/deActivate/5 should be calling the function deActivate ($id) in the testimonials_controller.php but I keep getting the error: You are seeing this error because the view for PagesController::testimonials/deActivate/5() could not be found. If you want to customize this error message, create app\views/errors/ missing_view.thtml. Fatal: Confirm you have created the file : C:\xampp\htdocs\nsg\app \views\pages\testimonials/de_activate/5.thtml I have had to configure routes.php to get my application working so I am unsure if this is the problem area but other functions in the controller that do not require an ID all perform fine. My routes looks like: $Route-connect ('/testimonials', array('controller'='testimonials', 'action'='index','index')); $Route-connect ('/testimonials/view', array('controller'='testimonials', 'action'='view','view')); $Route-connect ('/testimonials/add', array('controller'='testimonials', 'action'='add','add')); $Route-connect ('/testimonials/listActive', array('controller'='testimonials', 'action'='listActive','list_active')); $Route-connect ('/testimonials/listUnActive', array('controller'='testimonials', 'action'='listUnActive','list_unactive')); $Route-connect ('/testimonials/update/', array('controller'='testimonials', 'action'='update','index')); $Route-connect ('/testimonials/delete/', array('controller'='testimonials', 'action'='delete','index')); Any help would be appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: behavior acts_as_list
this is very cool. So this calls $CategoryController- admin_move_up(id) ... I assume you use a route to map that, or is there some other magic going on? (not to change the subject) Nope, no routes needed. It works completely transparently. The url /admin/categories/move_up/23 calls CategoriesController::admin_move_up(23), as you would expect CategoriesController doesn't implement admin_move_up(), but AppController does, so the AppController version is called, and it just works. On Feb 13, 11:02 am, wirtsi [EMAIL PROTECTED] wrote: Hi ... as sbeam said, transactions wouldn't help, it had to be good ol' locking. I was able to reproduce this error quite easily, so I'm not too sure about the one in a million thing. I tweaked grigri ListBehavior class a bit to support locking. I first used table locks but because of the way Cake handles the updates you have to lock half the database to get the update done. So I used the GET_LOCK funtions you mentioned. What struck me funny is that GET_LOCK always returns 1, no matter if a lock exists or not. Perhaps I got the the documentation wrong or it has to do with the Windows box I'm on ... anyway, only IS_FREE_LOCK would properly recognise the lock. Also $model-query is a really dangerous thing to use. Since it caches stuff like SELECT IS_FREE_LOCK this query only gets executed the first time, took me a while to figure that out. Abusing $model-field (only a bit :) works way better. You'll find the behavior herehttp://bin.cakephp.org/view/1410543845 ... comments are very welcome wirtsi On 12 Feb., 19:09, sbeam [EMAIL PROTECTED] wrote: thanks for the explanation on calling Behaviors... On Feb 12, 9:20 am, grigri [EMAIL PROTECTED] wrote: This way, if controller CategoriesController works on model Category, then the following links will work without any extra controller or model code whatsoever: /admin/categories/move_up/{id} /admin/categories/move_down/{id} this is very cool. So this calls $CategoryController-admin_move_up(id) ... I assume you use a route to map that, or is there some other magic going on? (not to change the subject) [I even have a generic helper to make a mini-toolbar with view, edit, delete and move options for a given model, so in most cases I just go echo $tool-bar($id) for each record, and it works transparently. I'm in to writing as little code as possible to get the job done.] Nice! I will have to try that at some pint. cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: 500 errors with Dreamhost?
Is your site working locally? I have several CakePHP sites running on DreamHost... none of them have any special .htaccess changes. There have been a few times that I had this 500 error issue and had to just delete all the files on the server and reupload the whole site and it seemed to fix the issue... it was as if something got jacked during upload... I chalked it up to my FTP app doing something weird or not completely writing a file. On Feb 13, 3:10 pm, Siebren Bakker [EMAIL PROTECTED] wrote: I'm running a CakePHP website using Dreamhost, hosted @ beta.aevumdecessus.com. the webroot for that is pointing to /home/**/beta/app/weboot. I just uploaded the files to the beta directory, changed the webroot folder, and it worked perfectly fine for me, still does actually. Never had to edit any of the htaccess files, just the cake config ones. I'd try to get ahold of dreamhost support on this one. I'm hosted on the Cheezit server On Feb 13, 2008 2:06 PM, Action [EMAIL PROTECTED] wrote: For those of you who use CakePHP on Dreamhost with PHP 5.2.2 enabled, did you have to modify the default htaccess files that come with Cake for it to work? I have my domain pointing to /home/yoursusername/yourdomain.com/app/ webroot/ in the web panel. -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a20 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: 500 errors with Dreamhost?
I'm running CakePHP 1.1.x application on Dreamhost with the original .htaccess with success IfModule mod_rewrite.c RewriteEngine on RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule On Feb 13, 3:20 pm, Action [EMAIL PROTECTED] wrote: I am getting 500 errors with a fresh CakePHP installation on Dreamhost (PHP 5.2.2). Is this something that can be fixed by changing the htaccess files? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Xml and CAKE_ADMIN
I'm newbie in cake Can you make ma an example of this? On 5 Feb, 23:50, Adam Royle [EMAIL PROTECTED] wrote: Webservices have been deprecated afaik in later versions because of this confusion. If you upgrade to the latest 1.2 version you can use Router::parseExtensions('xml'); and then your URL would be: mysite.com/admin/controller/action.xml However, if you can't upgrade, maybe you can set a setup route for your xml/admin combination. Cheers, Adam On Jan 18, 6:53 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi I have configurated CakePHP with webservice and CAKE_ADMIN enable. If I use them separately they work perfectly. But If I would use then together which url have I to use? http:www.mysite.com/xml/admin/controller/view doesn't work http:www.mysite.com/xml/controller/admin/view doesn't work- Nascondi testo tra virgolette - - Mostra testo tra virgolette - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 Schema could not be loaded
Hi again, I have manage to set up the %path% as shown is the screencast (bake for windows), i had a problem with my %path% variable but i fixed it up. I still have the message : Error: schema.php could not be loaded when I lauch cake schema create run Dbacl from d:\www\cake\app\ wich is my app directory If only lauch cake i have : Current Paths: -working: D:\www\cake\app -root: D:\www\cake -app: D:\www\cake\app\ -core: D:\www\cake\ As flash said : this drive me crazy Thanks in advance FoW --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Prototype/Scriptaculous causes background-color problem
Whenever I include prototype.js and scriptaculous.js using simply: script type=text/javascript src=/js/scriptaculous/lib/ prototype.js/script script type=text/javascript src=/js/scriptaculous/src/ scriptaculous.js/script my Safari browser starts to leave out pieces of the background color, parts turn white. In my CSS i've declared both background-color and background-image. (a .png with transparency) Leaving out one of the script tags above eliminates the problem (and its javascript functionality) Firefox, Camino and Opera handle it right. Does this problem sound familiar to anyone and does anyone have an idea what the cause+solution is? Cheers! Bart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
'Notice: undefined index' only in baked views
hi all, i uses cake 1.1.19.6305 and got pb while baking views. i got 'Notice: Undefined index' when cake is trying to build a link to the view of an associated model. in the baked source of a index.thtml, you clearly see the problem : e.g. ?php echo $html-link($catwalk['']['id'], '/admin/catwalkhomes/ view/' .$catwalk['']['id'])? instead of : ?php echo $html-link($catwalk['catwalkhomes']['id'], '/admin/ catwalkhomes/view/' .$catwalk['catwalkhomes']['id'])? i don't have this pb if i'm using 'pure' scaffolding so the pb must be in bake ? FYI : i got this warning (don't know if related) Warning: Invalid argument supplied for foreach() in D:\... \cake_1.1.19.6305\cake\scripts\bake.php on line 917 what am i missing ? thanks 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: modifying datas in beforeValidate (ya, again...)
so there's no way to modify data in model and then see this change in the controller ? On Feb 12, 11:07 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: put this in your controller: $this-data = $modifiedData; On Feb 12, 2008 7:17 PM, Dia [EMAIL PROTECTED] wrote: hi I know this question was already asked a few times and I read some topics about it on this g.group but didn't find the answer I'm looking for (found put it in controller, for example) so, how can I change the value of an attribute of a model in beforeValidate and then see this change on the value displayed in the form ? example: write 'foo' in the form set the value of this field to 'bar' in beforeValidate the value must be 'foo' to be validated so validation fails, ok but I still see 'foo' in the form field, I should see 'bar' ... ??? thanks 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 -~--~~~~--~~--~--~---
Caching and writing to sessions
Hi, I have an entire view that I cache other than a phone number that is output based on the user's geographic location ...US visitors would see an 1-800 number, UK 0800 etc. Therefore I have cached the view using the $cacheAction array within the controller and written a helper that looks up the user's IP and outputs the correct phone number based on their location. The helper call within the view is wrapped with no cache tags cake:nocache?=$geoip-getSalesNumber()? /cake:nocache My problem is that within the helper class I read and write to sessions to prevent overhead with accessing an ip-lookup service, however you cannot write to sessions within helpers. I have worked around this by using PHP's session support. I would just like to know if there is a better way for me to do this other than the before mentioned hack? This is a public website so there is no opportunity in setting a session within a login script. Many 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: modifying datas in beforeValidate (ya, again...)
If you modify data in the model, and controller has a reference to it, then the change will be visible in the controller. But, FormHelper gets the values for de inputs from Controller::$data (it gets passed to view, then to helpers). So pull your changes back into Controller::$data['Model']. HTH, - Dardo Sordi. On Thu, Feb 14, 2008 at 10:16 AM, Dia [EMAIL PROTECTED] wrote: so there's no way to modify data in model and then see this change in the controller ? On Feb 12, 11:07 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: put this in your controller: $this-data = $modifiedData; On Feb 12, 2008 7:17 PM, Dia [EMAIL PROTECTED] wrote: hi I know this question was already asked a few times and I read some topics about it on this g.group but didn't find the answer I'm looking for (found put it in controller, for example) so, how can I change the value of an attribute of a model in beforeValidate and then see this change on the value displayed in the form ? example: write 'foo' in the form set the value of this field to 'bar' in beforeValidate the value must be 'foo' to be validated so validation fails, ok but I still see 'foo' in the form field, I should see 'bar' ... ??? thanks 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: 500 errors with Dreamhost?
Check your permissions: /tmp etc.. And clear those folders. I've experienced weird things if I upload old tmp/cache files from local On Thu, Feb 14, 2008 at 4:54 AM, frederic bollon [EMAIL PROTECTED] wrote: I'm running CakePHP 1.1.x application on Dreamhost with the original .htaccess with success IfModule mod_rewrite.c RewriteEngine on RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule On Feb 13, 3:20 pm, Action [EMAIL PROTECTED] wrote: I am getting 500 errors with a fresh CakePHP installation on Dreamhost (PHP 5.2.2). Is this something that can be fixed by changing the htaccess files? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
i18n language specific URLs
In his article at: http://bakery.cakephp.org/articles/view/diy-international-i18n-urls-in-cake-1-1-x-or-lower Dieter Plaetinck discusses translation of URLs for CakePHP 1.1x. He alludes to a simpler more integrated way to do this in 1.2, but the only documentation I can find on this appears more complex and doesn't really deal with URL translation, more message internationalization. Dieter's approach for 1.1 looks simple enough. Is there any reason it wouldn't work in 1.2? Or can anyone point me at a suitable article/ tutorial? 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: 500 errors with Dreamhost?
I think this issue has come up before. See: http://groups.google.com/group/cake-php/browse_thread/thread/62b7f16e9be8be5/cb87b2b2a16bcfcb?lnk=gstq=dreamhost#cb87b2b2a16bcfcb You can work around it by using your own PHP. See the Dreamhost Wiki for instructions on how to set this up. On Feb 13, 9:20 am, Action [EMAIL PROTECTED] wrote: I am getting 500 errors with a fresh CakePHP installation on Dreamhost (PHP 5.2.2). Is this something that can be fixed by changing the htaccess files? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: 500 errors with Dreamhost?
On Wed, Feb 13, 2008 at 5:06 PM, Action [EMAIL PROTECTED] wrote: For those of you who use CakePHP on Dreamhost with PHP 5.2.2 enabled, did you have to modify the default htaccess files that come with Cake for it to work? I have it working perfectly with no changes. (Using PHP 5.2.2) I have my domain pointing to /home/yoursusername/yourdomain.com/app/ webroot/ in the web panel. I have my domain pointing to /home/yoursusername/yourdomain.com/ Regards, -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.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: 500 errors with Dreamhost?
That thread doesn't list a solution though. I'm on DreamHost using __() and have no problems. The only thing I have slightly different is that I point all my sites directly to webroot/. On Thu, Feb 14, 2008 at 8:38 AM, MattC [EMAIL PROTECTED] wrote: I think this issue has come up before. See: http://groups.google.com/group/cake-php/browse_thread/thread/62b7f16e9be8be5/cb87b2b2a16bcfcb?lnk=gstq=dreamhost#cb87b2b2a16bcfcb You can work around it by using your own PHP. See the Dreamhost Wiki for instructions on how to set this up. On Feb 13, 9:20 am, Action [EMAIL PROTECTED] wrote: I am getting 500 errors with a fresh CakePHP installation on Dreamhost (PHP 5.2.2). Is this something that can be fixed by changing the htaccess files? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 JQuery replacing Prototype in cake?
I recently read something about cake moving to JQuery instead of Prototype. Anyone know whether this is true? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Is JQuery replacing Prototype in cake?
On Thu, Feb 14, 2008 at 9:58 AM, keymaster [EMAIL PROTECTED] wrote: I recently read something about cake moving to JQuery instead of Prototype. Anyone know whether this is true? Where did you read this? -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Is JQuery replacing Prototype in cake?
He may have heard nate saying it on the latest The Show episode. -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 Chris Hartjes Enviado el: Jueves, 14 de Febrero de 2008 12:00 p.m. Para: cake-php@googlegroups.com Asunto: Re: Is JQuery replacing Prototype in cake? On Thu, Feb 14, 2008 at 9:58 AM, keymaster [EMAIL PROTECTED] wrote: I recently read something about cake moving to JQuery instead of Prototype. Anyone know whether this is true? Where did you read 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: Is JQuery replacing Prototype in cake?
On Thu, Feb 14, 2008 at 11:13 AM, Mariano Iglesias [EMAIL PROTECTED] wrote: He may have heard nate saying it on the latest The Show episode. -MI I see... Well, I think the first step would be to create an jQuery helper similar to what we have existing already. And no, I'm not volunteering to do that. Felix should be able to whip that up during a one-hour talk. ;) -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Is JQuery replacing Prototype in cake?
Hey, Good times! There are a lot of arguments as to which of these frameworks is better. But IMO, I think JQuery is better suited to CakePHP's uses. Just need to include the form plugin (can't live without it). Currently, I just dump a JS block at the top of my view/element when needed and make sure I define my own IDs or DIV holders. On Thu, Feb 14, 2008 at 10:13 AM, Mariano Iglesias [EMAIL PROTECTED] wrote: He may have heard nate saying it on the latest The Show episode. -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 Chris Hartjes Enviado el: Jueves, 14 de Febrero de 2008 12:00 p.m. Para: cake-php@googlegroups.com Asunto: Re: Is JQuery replacing Prototype in cake? On Thu, Feb 14, 2008 at 9:58 AM, keymaster [EMAIL PROTECTED] wrote: I recently read something about cake moving to JQuery instead of Prototype. Anyone know whether this is true? Where did you read 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: Prototype/Scriptaculous causes background-color problem
On Thu, Feb 14, 2008 at 5:45 AM, Bart [EMAIL PROTECTED] wrote: Whenever I include prototype.js and scriptaculous.js using simply: script type=text/javascript src=/js/scriptaculous/lib/ prototype.js/script script type=text/javascript src=/js/scriptaculous/src/ scriptaculous.js/script my Safari browser starts to leave out pieces of the background color, parts turn white. In my CSS i've declared both background-color and background-image. (a .png with transparency) Leaving out one of the script tags above eliminates the problem (and its javascript functionality) Firefox, Camino and Opera handle it right. Does this problem sound familiar to anyone and does anyone have an idea what the cause+solution is? No, but I'm guessing it's not a Cake problem. Try creating a plain HTML page--no PHP, no includes, etc.--and check the page in Safari. That is, serve the page from a non-Cake virtual host. If you still see the problem ask on a list dedicated to Prototype or Scriptaculous. Safari's a great browser but some versions are maddeningly buggy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: modifying datas in beforeValidate (ya, again...)
ok, thanks On Feb 14, 2:38 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: If you modify data in the model, and controller has a reference to it, then the change will be visible in the controller. But, FormHelper gets the values for de inputs from Controller::$data (it gets passed to view, then to helpers). So pull your changes back into Controller::$data['Model']. HTH, - Dardo Sordi. On Thu, Feb 14, 2008 at 10:16 AM, Dia [EMAIL PROTECTED] wrote: so there's no way to modify data in model and then see this change in the controller ? On Feb 12, 11:07 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: put this in your controller: $this-data = $modifiedData; On Feb 12, 2008 7:17 PM, Dia [EMAIL PROTECTED] wrote: hi I know this question was already asked a few times and I read some topics about it on this g.group but didn't find the answer I'm looking for (found put it in controller, for example) so, how can I change the value of an attribute of a model in beforeValidate and then see this change on the value displayed in the form ? example: write 'foo' in the form set the value of this field to 'bar' in beforeValidate the value must be 'foo' to be validated so validation fails, ok but I still see 'foo' in the form field, I should see 'bar' ... ??? thanks 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: Setting an alternate view
thx alot, got it! On Feb 14, 1:46 am, the_woodsman [EMAIL PROTECTED] wrote: Sounds like you're looking for the controller's render() method. It's always good to check the manual (http://manual.cakephp.org/ chapter/controllers) or the API (http://api.cakephp.org/ class_controller.html) first :) On Feb 13, 10:53 pm, subnet [EMAIL PROTECTED] wrote: Hi all, is there any way to set an alternate view(-template) inside a controller? f.e. class UsersController extends AppController { function login() { if (...) // default: render with view login.thtml else // render with a different view, f.e. login_error.thtml } thx, michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 someone please explain to me what {n} is?
thanks to both of you guys! On Feb 14, 12:22 am, su6z3r0 [EMAIL PROTECTED] wrote: {n} is a placeholder for numbered keys in arrays. So this would translate into something like [1]['Role']['id'] [2]['Role']['id'] [3]['Role']['id'] . . . Check this page:http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-... Felix explains how tho use Set::extract which also uses the {n} syntax HTH, Alex On Feb 14, 1:55 am, quoc [EMAIL PROTECTED] wrote: In the cake manual this is an example of the generateList function: $this-set( 'Roles', $this-Role-generateList(null, 'role_name ASC', null, '{n}.Role.id', '{n}.Role.role_name') ); I see this around a lot {n}.Role.id but I can't seem to figure out what the {n} means. I've been trying to search for it but I can't find anything on 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: can someone please explain to me what {n} is?
I have put this thread in the FAQ (http://groups.google.com/group/cake- php/web/frequent-discussions) Jc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Is JQuery replacing Prototype in cake?
On Feb 14, 8:36 pm, Baz [EMAIL PROTECTED] wrote: Good times! There are a lot of arguments as to which of these frameworks is better. But IMO, I think JQuery is better suited to CakePHP's uses. Just need to include the form plugin (can't live without it). Currently, I just dump a JS block at the top of my view/element when needed and make sure I define my own IDs or DIV holders. snip FWIW, my previous take https://trac.cakephp.org/ticket/2359 -- ?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: Switching useDbConfig variable
Aproveitando o assunto ... Meu problema é o seguinte: Tenho um método no meu MODEL, onde: 1) Através da conexão default, crio um novo banco de dados (o nome do banco de dados é passado dinâmicamente para o meu método); 2) Atribuo privilégios para um usuário, que também é recebido pelo método do meu MODEL. 3) Preciso criar (com os parâmetros recebidos pelo método) uma nova conexão na classe DATABASE_CONFIG, ou pelo menos passar os parâmetros de conexão (host, login, password, database); 4) Tornar essa conexão default; ou setá-la em $this- useDbConfig; 5) Executar instruções no banco de dados, através dessa conexão. Enfim, é isso. Obrigado. Paulo. On 8 fev, 16:56, Corie [EMAIL PROTECTED] wrote: Oh, nevermind. I just reread. I guess I was simply trying to set up the if else inside thedatabase_configclass and set the $default accordingly. On Feb 8, 1:37 pm, Corie [EMAIL PROTECTED] wrote: That actually does look like a better solution, as I was also trying to figure out how to make it switch for all Models. I'm a bit new to OOP, how do you set up your /config/database.php file? You have to put the conditionals in a function right? On Feb 8, 11:32 am, grigri [EMAIL PROTECTED] wrote: Interesting... I do it a completely different way. I have 2 database config files : database.dev.php and database.live.php, each containing a fullDATABASE_CONFIGclass with my configurations (default, test, and whatever else I need for the app). Then, in /config/database.php, I have this: if (empty($_SERVER['SERVER_NAME']) || in_array(strtolower($_SERVER[SERVER_NAME]), array('grigri', 'localhost'))) { require ./database.dev.php;} else { require ./database.live.php; } This way the models don't have to make any changes, it's all automatic. How do other people deal with this? On Feb 8, 4:23 pm, Corie [EMAIL PROTECTED] wrote: I'm running the same cake app on two different servers, development and production. I want to change the database config that's used depending on the server. I've got the following set up now. /config/database.php classDATABASE_CONFIG{ var $development = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'admin', 'password' = 'password', 'database' = 'db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); var $production = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'port' = '', 'login' = 'user_admin', 'password' = 'password', 'database' = 'user_db', 'schema' = '', 'prefix' = '', 'encoding' = '' ); } /models/table.php class Table extends AppModel { var $name = 'Table'; function beforeFind() { if(is_dir('D:\webserver\private_html\site')) { $this-useDbConfig = 'development'; } elseif(is_dir(DS.'home'.DS.'user'.DS.'public_html')) { $this-useDbConfig = 'production'; } } } It just keeps trying to use the 'default' config. I've also tested my logic by just putting $this-useDbConfig = 'development'; directly under the beforeFind() function, but it still does nothing. Do I need to put this somewhere else?- Ocultar texto entre aspas - - Mostrar texto entre aspas - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Primary Keys
I notice that everyone using Cake seems to use autoincrementing integer primary keys. However this means you always have to join the code files for all queries and reports because the keys don't mean anything (unless you can memorize lots of numbers). In the past I have successfully used more recognisable alphanumeric primary keys, and I appreciate that one must manage these manually but it makes end-user reporting much more intuitive. e.g. Contacts idLastnameContacttype_id ------ 1 FredTELE 2 Joe MEET 3 Alan MAIL etc Contacttypes idName Status ------ -- TELE Telephone Call A MEET Meeting B MAILEmail A etc The users are using an end-user reporting application and will be able to make a simple query on the Contacts table which will provide the info he needs without making any joins. In fact the user wouldn't need to know about joins unless for example he needs to get the 'status' in which case his supervisor can assist. My questions are: 1. Is the 'cost' of having non-standard primary keys too great a price to pay in terms of losing some of Cake's built-in power? I'm not even sure what functionality we might miss. 2. Clearly the above tables are greatly simplified; the real-life tables would require many joins. If I don't use the alphanumeric keys, I would have to go around and teach a lot of people how to join up the tables to make their reports. Does everyone advocate teaching end-users about the principles of the SQL SELECT? I am sure that I'm not the first to have this dilemma, but maybe someone might give me a bit of advice based on their own experience? D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Primary Keys
I'm curious to see some of the other responses, but here's mine. I don't think I understand what you're trying to accomplish. If you build an application in Cake, then no end user sees the resulting SQL, what the keys are shouldn't matter. What I _think_ you're saying is that OUTSIDE of Cake, you're using a third party application to do reports with joins? If so, I don't quite understand how users can join tables (on char keys or numeric) if they don't know what they are doing...Either this 3rd party application knows how to join or it doesn't. But regardless of what your app. can and cannot do, this is not a CakePHP specific problem. As far as I am aware, your primary keys can be anything of your choosing. Obvious, if it's not auto-incrementing then you are personally going to have to manage how they get set when you add Contacttypes, for example. It would be as simple as putting in the field in the form. If not, you'll have SQL errors. This would be a problem in any other type of application. Again, your intent is a bit vague to me, but regardless the only constraint that I am aware of with CakePHP is the the primary key cannot be composite. On Thu, Feb 14, 2008 at 11:44 AM, villas [EMAIL PROTECTED] wrote: I notice that everyone using Cake seems to use autoincrementing integer primary keys. However this means you always have to join the code files for all queries and reports because the keys don't mean anything (unless you can memorize lots of numbers). In the past I have successfully used more recognisable alphanumeric primary keys, and I appreciate that one must manage these manually but it makes end-user reporting much more intuitive. e.g. Contacts idLastnameContacttype_id ------ 1 FredTELE 2 Joe MEET 3 Alan MAIL etc Contacttypes idName Status ------ -- TELE Telephone Call A MEET Meeting B MAILEmail A etc The users are using an end-user reporting application and will be able to make a simple query on the Contacts table which will provide the info he needs without making any joins. In fact the user wouldn't need to know about joins unless for example he needs to get the 'status' in which case his supervisor can assist. My questions are: 1. Is the 'cost' of having non-standard primary keys too great a price to pay in terms of losing some of Cake's built-in power? I'm not even sure what functionality we might miss. 2. Clearly the above tables are greatly simplified; the real-life tables would require many joins. If I don't use the alphanumeric keys, I would have to go around and teach a lot of people how to join up the tables to make their reports. Does everyone advocate teaching end-users about the principles of the SQL SELECT? I am sure that I'm not the first to have this dilemma, but maybe someone might give me a bit of advice based on their own experience? D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
DATABASE CONFIG dinâmico ....
Meu problema é o seguinte: Tenho um método no meu MODEL, onde: 1) Através da conexão default, crio um novo banco de dados (o nome do banco de dados é passado dinâmicamente para o meu método); 2) Atribuo privilégios para um usuário, que também é recebido pelo método do meu MODEL. 3) Preciso criar (com os parâmetros recebidos pelo método) uma nova conexão na classe DATABASE_CONFIG, ou pelo menos passar os parâmetros de conexão (host, login, password, database); 4) Tornar essa conexão default; ou setá-la em $this- useDbConfig; 5) Executar instruções no banco de dados, através dessa conexão. Enfim, é isso. Se alguém puder me ajudar, agradeço. Paulo Augusto M. Pereira. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
trouble with Attachments behavior/component
Cake 1.2.0.6311-beta Attachments 0.40RC I'm trying to get David Persson's Attachments behavior/component working with little success. I can't get it to pick up any attachments for my model. I've been poring over the source and am still a little baffled as to how this should work. Because of that, I'm having a lot of dificulty figuring out where the problem lies (Well, I think the problem lies with my limited understanding of the way Cake works, generally). This part of my app looks like this: Member-hasMany-Showcase A Showcase is essentially an item in a Member's gallery. I have a table named 'attachments' and have inserted the image (and video, audio) data into it, eg: id | 415 model | Showcase foreign_key | 234 dirname | files/showcase/espana_keller_j basename| espana_keller_39692.mov checksum| 86fb86893fd829912145f303f39e869b mime_type | video/quicktime thumbnail | espana_keller_39692.png created | 2008-02-13 20:12:57.99675 modified| 2008-02-13 20:12:57.99675 AppModel has: var $actsAs = array('Bindable' = array('notices' = true)); (perhaps this is causing problems?) Showcase model has: var $actsAs = array('Attachment' = array( 'dirname' = '{DIRNAME}', 'basename' = '{BASENAME}' ) ); I don't know if that syntax is correct for overriding the defaults. The ShowcasesController has: var $components = array('Attachment'); function index() { $conditions = array( 'restrict' = array( 'Member(first_name, last_name, slug)' ) ); $showcases = $this-Showcase-find('all', $conditions); ... } Now, maybe using Bindable is the problem here, but I can't find anything in the docs for Attachment that says I must specify any conditions at all. However, I do see this warning (thrown because there are no conditions): Warning (2): Invalid argument supplied for foreach() [APP/models/ behaviors/attachment.php, line 233] When I try adding conditions appropriate to Attachment I see this: Notice (1024): Showcase.Attachment is not a valid binding [APP/models/ behaviors/bindable.php, line 465] Anyone have any ideas of what I should have in my controller to get it to pick up the Attachments specific to each Showcase when I do a find('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: My Blog - Need Help With Finishing Touches
Thanks Looks good! Quick Questions, what exactly is a slug? It says it's devault value for slug will be the slug field in my database but I do not have this. Inflector::slug(Quick Questions, what exactly is a slug?) = 'Quick_Questions__what_exactly_is_a_slug_' just add a slug field to your database. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 divide too large controller into small?
Thank you for your reply. Yes, I try to thin controllers, and most of business logics move to model. But my UsersController has register(), activate(), resign(), edit(), etc... It has over 500 lines PHP Code. So I want to divide it into small files which have less than 50-100 lines code. On 2/14/08, am7:06, Marcin Domanski [EMAIL PROTECTED] wrote: Hi, Why do yopu want to devide the controller methods ? the whole purpose of a controller is to _group_ them. You should think about fat model, thin controllers - do a search on that , also you might take a look at editors wich support code folding - vim, eclipse and *many* others. On 2/13/08, sanemat [EMAIL PROTECTED] wrote: Controllers which have many method (like users_controller) are liable to large. example: app/controllers/examples_controller.php class ExamplesController extends AppController { function index(){} function edit(){} function add(){} etc... } I want divide this into small file each method. But I don't know how to do it with CakePHP standard. Now I have 2 ideas. --start-- add: app/controllers/examples_edit_controller.php class ExamplesEditController extends ExamplesController { function edit($id){ //ExamplesController's edit() content write this. } } edit: app/config/rontes.php Router::connect('/example/edit/*', array('controller' = 'examples_edit', 'action' = 'edit')); --end-- or --start-- add: app/controllers/examples/edit.php class ExamplesControllerEdit extends ExamplesController { function __construct($id){ //ExamplesController's edit() content write this. } } edit: app/controllers/examples_controller.php class ExamplesController extends AppController { function edit($id){ new ExamplesControllerEdit($id); } } --end-- But I feel these ideas bad. Above idea I must write many Router::connect rules. It will confuse me. below one I must call many 'require_once' or 'App::import' in every place. It will also confuse me. Please give me some advice. thanks. -- Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Validate one or two fields?
Yo can use this as is, also could be useful to put that in AppModel. MultivalidateModel is a (bad) example name, sorry. On Wed, Feb 13, 2008 at 11:13 PM, Siebren Bakker [EMAIL PROTECTED] wrote: @Dardo that looks perfect for what I need, just one quick question. Can I just use it in my User model, or do I need to create a multiValidate model, and if so, what would be the naming convention on that? On Feb 8, 2008 4:16 AM, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: You can set different set of rules on your model: Class MultivalidateModel extends AppModel { var $name = 'Multivalidate'; var $validationSets = array( 'default' = ... default rules, 'state1' = ... full validate array1, 'state2' = ... full validate array2, ); var $currentRuleSet = 'default'; function validates ($data =array()) { $this-validate = $this-$validationSets[$this-currentRuleSet]; parent::validates($data); } } } Also this can be put on a behavior. On Feb 7, 2008 2:25 PM, Siebren Bakker [EMAIL PROTECTED] wrote: I don't actually need to compare the information with that from the database, I just need to validate the data in the fields, preferably using the $validate array present in my User Model, in order to make sure that it is valid data for those fields, without having to add validation data to the controller On Feb 6, 2008 10:18 PM, Rgarg [EMAIL PROTECTED] wrote: do you want to cum pair user written data with database?? -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- Version: 3.12 GCS d- s+: a20 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DATABASE CONFIG dinâmico ....
In short he needs to create a way to receive value in the controller and writes them dynamically in database.php. Like a SETUP. 2008/2/14 pamp_php [EMAIL PROTECTED]: Meu problema é o seguinte: Tenho um método no meu MODEL, onde: 1) Através da conexão default, crio um novo banco de dados (o nome do banco de dados é passado dinâmicamente para o meu método); 2) Atribuo privilégios para um usuário, que também é recebido pelo método do meu MODEL. 3) Preciso criar (com os parâmetros recebidos pelo método) uma nova conexão na classe DATABASE_CONFIG, ou pelo menos passar os parâmetros de conexão (host, login, password, database); 4) Tornar essa conexão default; ou setá-la em $this- useDbConfig; 5) Executar instruções no banco de dados, através dessa conexão. Enfim, é isso. Se alguém puder me ajudar, agradeço. Paulo Augusto M. Pereira. -- Renan Gonçalves - Software Engineer Cell Phone: +55 (11) 8633-6018 MSN: [EMAIL PROTECTED] Web Site: renangoncalves.com São Paulo - SP/Brazil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 divide too large controller into small?
In OOP theory you can have classes with loads of methods, as long as it makes sense. Controller methods can be collpsed by almost all editors. Dont divide that controller that way. Dont worry with 500 lines of PHP, as long as all methods are part of Users. On Feb 14, 7:05 pm, sanemat [EMAIL PROTECTED] wrote: Thank you for your reply. Yes, I try to thin controllers, and most of business logics move to model. But my UsersController has register(), activate(), resign(), edit(), etc... It has over 500 lines PHP Code. So I want to divide it into small files which have less than 50-100 lines code. On 2/14/08, am7:06, Marcin Domanski [EMAIL PROTECTED] wrote: Hi, Why do yopu want to devide the controller methods ? the whole purpose of a controller is to _group_ them. You should think about fat model, thin controllers - do a search on that , also you might take a look at editors wich support code folding - vim, eclipse and *many* others. On 2/13/08, sanemat [EMAIL PROTECTED] wrote: Controllers which have many method (like users_controller) are liable to large. example: app/controllers/examples_controller.php class ExamplesController extends AppController { function index(){} function edit(){} function add(){} etc... } I want divide this into small file each method. But I don't know how to do it with CakePHP standard. Now I have 2 ideas. --start-- add: app/controllers/examples_edit_controller.php class ExamplesEditController extends ExamplesController { function edit($id){ //ExamplesController's edit() content write this. } } edit: app/config/rontes.php Router::connect('/example/edit/*', array('controller' = 'examples_edit', 'action' = 'edit')); --end-- or --start-- add: app/controllers/examples/edit.php class ExamplesControllerEdit extends ExamplesController { function __construct($id){ //ExamplesController's edit() content write this. } } edit: app/controllers/examples_controller.php class ExamplesController extends AppController { function edit($id){ new ExamplesControllerEdit($id); } } --end-- But I feel these ideas bad. Above idea I must write many Router::connect rules. It will confuse me. below one I must call many 'require_once' or 'App::import' in every place. It will also confuse me. Please give me some advice. thanks. -- Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Plugins Rant - All CakePHP experts and software architect called
I wrote this paper in the past two days. Comes from a design problem I had some days ago. Please read and let discuss this here. If I am totally wrong please let me know. http://blog.zerone.weblusa.org/papers/cakephp-plugins/ Thanks for your time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 tree behavior + ext js (drag and drop)
hmmm there is no white space in the controller.. with the exit function it should not use a view right? So i guess that is not it.. Umm also the requesthandler is loaded.. but it does not work with me, i really need to set the layout.. but maybe its because of my cakephp install cause the secutiry component does not work either : Undefined property: EmployeesController::$Security So i need to comment that out to get it to work... im using latest version from svn. So maybe there are some bugs in that. Because there are some other things too.. like load a helper that does not exists in app_controller and it will crash apache, when i go to a controller that does not exists :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Database design question
Hi group I'm sure I've asked this before but, to save time (yours and mine!), I'm going to simplify this. My company sends out engineers to work on customer sites. When they get to site, they can do one of many things. I have listed each action in a table of its own, each scheduled visit in a table of its own and each engineer in a table of its own. I have created a form with multiple select boxes[1] which I can select each of my options; this works fine. My problem comes when I try to save this data. If I print the output of $this-data, I get Array ( [Visitaction] = Array ( [visit_id] = 7 ) [Actiontypes] = Array ( [id] = Array ( [0] = 2 [1] = 3 ) ) ) My Visitaction table has fields for the visit_id and for actiontype_id but I'm unsure how cake would store multiple selections. I know I could do this by having a YES/NO type field for each possible action within each visit but this seems to be very wasteful. The other thing I could potentially do is to write a loop and save multiple records for each actiontype selected; however, I'm sure there _MUST_ be a better way.I've just yet to find it. Can you help ? Thanks J [1] Code segments The php code in the view looks like: ?php echo $form-create('Visitaction', array('action'='/ add')); ? table class=clear input type=hidden name=data[Visitaction][visit_id] value=?php e cho $visitid; ? id=VisitactionVisitId tr td?php echo $form-select('Actiontypes.id', $actiontypes, null, a rray('multiple'='checkbox')); ?/td /tr /table table class=clear tr ?php echo $form-end('Update File'); ? /tr /table which creates html like: form id=Visitaction/addForm method=post action=/ visitactions/addfieldset style=display:none;input type=hidden name=_method value=POST //fieldsettable class=clear input type=hidden name=data[Visitaction][visit_id] value=7 id=VisitactionVisitId tr tdinput type=hidden name=data[Actiontypes][id] value= id=ActiontypesId / div class=checkboxinput type=checkbox name=data[Actiontypes] [id][] value=1 id=ActiontypesId1 /label for=ActiontypesId1Action 1/label/div div class=checkboxinput type=checkbox name=data[Actiontypes] [id][] value=2 id=ActiontypesId2 /label for=ActiontypesId2Action 2/label/div div class=checkboxinput type=checkbox name=data[Actiontypes] [id][] value=3 id=ActiontypesId3 /label for=ActiontypesId3Action 3/label/div div class=checkboxinput type=checkbox name=data[Actiontypes] [id][] value=4 id=ActiontypesId4 /label for=ActiontypesId4Action 4/label/div /td /tr /table table class=clear tr div class=submitinput type=submit value=Update File //div/form /tr /table --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
two views and one method
how i can use two views with a single method of a controller? if(something){ use default view }else{ use another view } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 tree behavior + ext js (drag and drop)
Sounds like you've got problems with your install. I have just tested my app with both 1.2 trunk and 1.2 branch from svn, and can't replicate the problems you've mentioned. Since I developed this using 1.2 branch, I had assumed everything would work in 1.2 trunk, however there was a bug with the javascript helper in trunk that has now been fixed in branch (https:// trac.cakephp.org/ticket/3799). I did actually get it working fine in 1.2 trunk after I removed the /js/ prefix from the link in the layout. I suggest you try a fresh svn export, and use the source files I've provided in the download. With the whitespace issue - maybe it's got something to do with UTF-8 BOM being at the top of your files? But I am only speculating on this, the files I've provided shouldn't have this issue. Cheers, Adam On Feb 15, 6:42 am, Mech7 [EMAIL PROTECTED] wrote: hmmm there is no white space in the controller.. with the exit function it should not use a view right? So i guess that is not it.. Umm also the requesthandler is loaded.. but it does not work with me, i really need to set the layout.. but maybe its because of my cakephp install cause the secutiry component does not work either : Undefined property: EmployeesController::$Security So i need to comment that out to get it to work... im using latest version from svn. So maybe there are some bugs in that. Because there are some other things too.. like load a helper that does not exists in app_controller and it will crash apache, when i go to a controller that does not exists :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 views and one method
Call the render function with the view name. $this-render('view_name'); On Thu, Feb 14, 2008 at 9:32 PM, Shadows_Cl [EMAIL PROTECTED] wrote: how i can use two views with a single method of a controller? if(something){ use default view }else{ use another view } -- Renan Gonçalves - Software Engineer Cell Phone: +55 (11) 8633-6018 MSN: [EMAIL PROTECTED] Web Site: renangoncalves.com São Paulo - SP/Brazil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Plugins Rant - All CakePHP experts and software architect called
On Thu, Feb 14, 2008 at 3:13 PM, MX [EMAIL PROTECTED] wrote: I wrote this paper in the past two days. Comes from a design problem I had some days ago. Please read and let discuss this here. If I am totally wrong please let me know. http://blog.zerone.weblusa.org/papers/cakephp-plugins/ Not that I'm ranting or anything, but you'd probably get more feedback if you at least summarised your arguments here on the list. It's not like your paper is too big for google to handle. My only comment at this time is, What previous chapter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Controller, Add Method.. setting default values..
Hi there, I guess I'm just not understanding fundamental... I have a simple controller with Baked methods for adding, editing etc.. I'm trying to modify the behaviour, when the add() method is invoked I want to populate a few default values for a couple of the fields.. My code currently looks like this: function add($resSomeIntegerValue) { if (empty($this-data)) { $this-data['Expense']['SomeField'] = $resSomeIntegerValue; $this-data['Expense']['AnotherField'] = 'A Default Value'; $this-render(); As you can see I've added two lines to set up 2 fields with the values I want as a default when calling this method. The view, when it renders, doesn't have these default values displayed.. Any help much appreciated. With thanks, Duncan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Controller, Add Method.. setting default values..
On Thu, Feb 14, 2008 at 9:03 PM, duncan_m [EMAIL PROTECTED] wrote: Hi there, I guess I'm just not understanding fundamental... I have a simple controller with Baked methods for adding, editing etc.. I'm trying to modify the behaviour, when the add() method is invoked I want to populate a few default values for a couple of the fields.. My code currently looks like this: function add($resSomeIntegerValue) { if (empty($this-data)) { $this-data['Expense']['SomeField'] = $resSomeIntegerValue; $this-data['Expense']['AnotherField'] = 'A Default Value'; $this-render(); As you can see I've added two lines to set up 2 fields with the values I want as a default when calling this method. The view, when it renders, doesn't have these default values displayed.. If you're not using those fields for your other views (or having these values in those fields wouldn't make a difference in other views) you could do this in the model's afterFind(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Controller, Add Method.. setting default values..
This works for me in latest 1.2. However, maybe this logic should be in your view?? echo $form-input('anotherfield', array('default' = 'A default value')); Cheers, Adam On Feb 15, 12:03 pm, duncan_m [EMAIL PROTECTED] wrote: Hi there, I guess I'm just not understanding fundamental... I have a simple controller with Baked methods for adding, editing etc.. I'm trying to modify the behaviour, when the add() method is invoked I want to populate a few default values for a couple of the fields.. My code currently looks like this: function add($resSomeIntegerValue) { if (empty($this-data)) { $this-data['Expense']['SomeField'] = $resSomeIntegerValue; $this-data['Expense']['AnotherField'] = 'A Default Value'; $this-render(); As you can see I've added two lines to set up 2 fields with the values I want as a default when calling this method. The view, when it renders, doesn't have these default values displayed.. Any help much appreciated. With thanks, Duncan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
session problem
I've session problem in CakePHP 1.1.19, because when I'm sailing in pages, the session expiring! the timeout is define('CAKE_SESSION_TIMEOUT', '120'); somebody had this problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CookBook and i18n
Hi people: I'm now trying to add i18n on a webapp but I dunno how's the right use of Translate Behavior. I'd seen that the new CookBook had i18n and I would be pleased to see the code. Anyone knows if there is a SVN/Trac or so to see how it works. Thanks -- http://www.userlinux.net http://7throot.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 -~--~~~~--~~--~--~---
i want to duplicate records and their associtations
hello all! i want to duplicate not ony one table record, but that record and it's associated records, and have the foreign keys changed to reflect the new insert_ids. for example, i have this association: weeks-days-hours i want to duplicate the week, it's days and hours too. So the foreign keys would be like this: weeks week_id days day_id week_id hours hour_id day_id ass you can see from the diagram, a new weeks.week_id would be created, which would have to replace the week id in the days table. the days.day_id would have to do the same cascade effect in the hours table, since day_id and hour_id would also be new key_ids. I believe this behavior exists in the saveall method when a new record is inserted. But not positive. Any help would be appreciated! -bp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 pluralisation doesnt work with my scaffolds..
Hi all, simple example: i make a ticket_activities table i make a ticket_activity.php file model with: class TicketActivity extends AppModel { var $name = 'TicketActivity'; } and a ticket_activities_controller.php with: class TicketActivitiesController extends AppController { var $scaffold; } and i get the following errors: Notice: Trying to get property of non-object Warning: Invalid argument supplied for foreach() Scaffolding works with tables without underscores tho I am running cake on a windows 2003 server with iis6 and php5 but without rewrite. Thanx 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 -~--~~~~--~~--~--~---
App Organization
This was brought up before, but never revisited. Here is the post that summed it up for me: This is the first I've heard of this, although I can see the sense in gwoo's words. Plugins need to be independant, or they can't be easily distributable from app to app or developer to developer. So, I guess gwoo is right, I had intended to use plugins to organize parts of a larger application. Sounds like many others also thought this way. - keymaster I'm also working on a large project and ideally I'd like to organize the project based on package, where each package has it's own folder structure of model / view / controller. Gwoo has addressed this and said it can be done through the bootstrap.php, but never really specified how. This is what he wrote: Correct me if I am wrong, but it seems some are using plugins to organize parts of a larger application. To me, you are on a slippery slope here to basically negating the whole benefit of a plugin and just making it more work on yourself. Using the config/bootstrap.php to organize your MVC requires a lot less code and should yield the same benefits. That said, there are some changes in the works that may allow this functionality. So time will tell, but at least you know why it works the way it does right now. I was wondering if there is any new information on 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: PostgreSQL Update Query and the trouble with aliases
I have the same problem so i wrote a correctif not a patch but soon i wrote a good patch to correct the update pb for postgresql. This correctif solve the problem for simple update and update with join conditions. In the file dbo_source.php at the line 1245 : you replace the line: case 'update': return UPDATE .. by: case 'update': //PATCH BY BLACKSHACK (2008) FOR POSTGRES $rta = trim(str_replace('AS ', '', $alias));//real table alias $fields = preg_replace(/{$rta}/, {$table}, $fields); $conditions = preg_replace(/{$rta}/, {$table}, $conditions); $joins = preg_replace(/{$rta}/, {$table}, $joins); $a_joins = split('LEFT JOIN', $joins); array_shift($a_joins); $f_joins = array();//FROM de jointure $w_joins = array();//WHERE de jointure foreach($a_joins as $join) { $join = trim($join); if(!empty($join)) { $dataJoin = split(' ON ', $join); $f_joins[] = trim($dataJoin[0]); if(isset($dataJoin[1])) { $w_joins[] = trim($dataJoin[1]); } } } $where = $from = ''; if(!empty($f_joins)) { $first = true; for($i = 0; $i count($f_joins); $i++ ) { if(isset($w_joins[$i])) { if(!$first){ $from .= ', '; $where .= ' AND '; } else { $first = false; $from = ' FROM '; } //je m'assure que pour chaque jointures il y a une conditions associé. //cela ne gênerai pas la présence d'une table en plus, mais ferait une jointure inutile en plus donc... $from .= $f_joins[$i]; $where .= preg_replace(/(^\(|\)$)/, '', $w_joins[$i]); } } } if($where !== '') { if(trim($conditions) === '') { $conditions = ' WHERE '.$where; } else { $conditions .= ' AND '.$where; } } return UPDATE {$table} SET {$fields} {$from} {$conditions}; ATTENTION !! this patch make cakephp work only for postgresql!!! you could make a conditon postgresql/mysql if you know how known which db is used and switch on. The code is 'long' because data given is already preformated for mysql, i must extract info and clean it before. Ine a future really multi SGBD framework, informations don't be arranged for a SGBD before call the renderStatement method. Bonne chance On 21 jan, 14:58, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm having trouble making UPDATE queries in PostgreSQL. I know that there is a known issue about Postgres not supporting aliases in UPDATE queries. Anyway, my problem is that when I try to create new Aro like this: $parent = $this-Acl-Aro-findByAlias('SuperUser'); $parentId = $parent['Aro']['id']; $this-Acl-Aro-create(); $this-Acl-Aro-save(array( 'foreign_key' = null, 'parent_id' = $parentId, 'alias' = 'User:30')); I get the following error: Warning (2): pg_query() [function.pg-query]: Query failed: ERROR: column Aro of relation aros does not exist LINE 1: UPDATE aros AS Aro SET Aro.lft = Aro.lft + 2 W... ^ [CORE\cake\libs\model\datasources \dbo\dbo_postgres.php, line
Has and belongs to many association question
For this question, lets assume I have 3 models: A, B, and C. I have a HABTM relationship setup between two models, A and B. The many to many table looks like this: id, a.id, b.id, c.id --- This can be NULL or it can be a record out of model C. What I want to do is to have the Model C record loaded if the value is not NULL. I have tried changing the level of recursion, but the problem is that the HABTM relationship doesn't know that c.id is a model that can be loaded and I don't know how to tell it such. Any advice? 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: i18n language specific URLs
2008/2/14, leo [EMAIL PROTECTED]: In his article at: http://bakery.cakephp.org/articles/view/diy-international-i18n-urls-in-cake-1-1-x-or-lower Dieter Plaetinck discusses translation of URLs for CakePHP 1.1x. He alludes to a simpler more integrated way to do this in 1.2, but the only documentation I can find on this appears more complex and doesn't really deal with URL translation, more message internationalization. Dieter's approach for 1.1 looks simple enough. Is there any reason it wouldn't work in 1.2? Or can anyone point me at a suitable article/ tutorial? Thanks I'm on same problem, it seems that the new CookBook has got a well language specific URL's, maybe we can see the source code and learn how to do. Any tip? -- http://www.userlinux.net http://7throot.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 -~--~~~~--~~--~--~---
Confused
Hi, I've recently started working with this incredible framework, but still feeling some frustrations when trying to accomplish some things. As a learning exercise, I'm trying to do the following (with no good results yet): I've created this tables: CREATE TABLE `brands` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `brand` VARCHAR( 200 ) NOT NULL ) ENGINE = innodb; CREATE TABLE `computers` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `hd_id` INT NOT NULL , `mother_id` INT NOT NULL , `processor_id` INT NOT NULL ) ENGINE = innodb; Ok, the system should allow users to insert computers, and have users select each part's brand (maxtor hd, intel mother, intel processor). I've tried building models and controllers for such operation with no success. Is there anything I'm doing wrong? Sorry if this is too basic, and thank you for helping 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 -~--~~~~--~~--~--~---
how to getting started ???
Hello All, I am a newbie. I just try to learn Zend Framework and CodeIgniter. Now I want to learn CakePHP. I have a problem. When I try code in Controller, Model and View. My hello world project always have a default layout with some help (query, bendmark ...) from framework core. But I dont want to see this layout. I want to do it see like CodeIgniter or ZF. Mean see only Hello World on webpage. Plzz tell detail how to remove default layout. Thanks so much. [ sorry if my English is poor ] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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 a controller method from a view
I don't know if this is possible but I need to call my controller from my view under very rare conditions to go back to the model/database to get a value. Is this possible? I am using cake 1.2. 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: PostgreSQL Update Query and the trouble with aliases
On Thu, Feb 14, 2008 at 5:11 PM, Blackshack [EMAIL PROTECTED] wrote: I have the same problem so i wrote a correctif not a patch but soon i wrote a good patch to correct the update pb for postgresql. This correctif solve the problem for simple update and update with join conditions. Monsieur, please take the time to go over to http://trac.cakephp.org and file a ticket for this problem and include your patch. I'm sure any Postgres users will appreciate it. Merci! -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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: Calling a controller method from a view
On Thu, Feb 14, 2008 at 9:21 PM, Snadly [EMAIL PROTECTED] wrote: I don't know if this is possible but I need to call my controller from my view under very rare conditions to go back to the model/database to get a value. Is this possible? I am using cake 1.2. Usually you need to pass values from the controller to the view. Is there any particular reason why this cannot be done either in the controller itself *or* through some use of Ajax where you call an action in your controller, and update an element in your page? Just asking... -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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 getting started ???
if you define your own layout named default.thml in app/views/layouts then cake's default layout wont come. Thanks. On 2/14/08, seonet(tm) [EMAIL PROTECTED] wrote: Hello All, I am a newbie. I just try to learn Zend Framework and CodeIgniter. Now I want to learn CakePHP. I have a problem. When I try code in Controller, Model and View. My hello world project always have a default layout with some help (query, bendmark ...) from framework core. But I dont want to see this layout. I want to do it see like CodeIgniter or ZF. Mean see only Hello World on webpage. Plzz tell detail how to remove default layout. Thanks so much. [ sorry if my English is poor ] -- Thanks Regards, Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling a controller method from a view
the usual way is $myvar = $this-requestAction('/your_controller/action/variables'); and that method returns your precious variable :) spakr On Fri, Feb 15, 2008 at 12:21 AM, Snadly [EMAIL PROTECTED] wrote: I don't know if this is possible but I need to call my controller from my view under very rare conditions to go back to the model/database to get a value. Is this possible? I am using cake 1.2. Thanks -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe 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: Controller, Add Method.. setting default values..
you are checking *if (empty($this-data))* is there some other data that is coming from the view(such as some other fields in the form) for you except these default fields. if there is some other data coming as well then $this-data wont be empty and hence your default values wont be populated.. it would be better to install the logic as: if ($this-data['Expense']['SomeField'] == '') { $this-data['Expense']['SomeField'] = 'A Default Value'; } I hope i were clear. Thanks. On 2/15/08, Adam Royle [EMAIL PROTECTED] wrote: This works for me in latest 1.2. However, maybe this logic should be in your view?? echo $form-input('anotherfield', array('default' = 'A default value')); Cheers, Adam On Feb 15, 12:03 pm, duncan_m [EMAIL PROTECTED] wrote: Hi there, I guess I'm just not understanding fundamental... I have a simple controller with Baked methods for adding, editing etc.. I'm trying to modify the behaviour, when the add() method is invoked I want to populate a few default values for a couple of the fields.. My code currently looks like this: function add($resSomeIntegerValue) { if (empty($this-data)) { $this-data['Expense']['SomeField'] = $resSomeIntegerValue; $this-data['Expense']['AnotherField'] = 'A Default Value'; $this-render(); As you can see I've added two lines to set up 2 fields with the values I want as a default when calling this method. The view, when it renders, doesn't have these default values displayed.. Any help much appreciated. With thanks, Duncan. -- Thanks Regards, Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to getting started ???
Thanks Novice Programmer, My Hello world is ok now. But when I try to work with database, html out put always have a table with query string and some infomation How to remove it. I want to have a layout same CodeIgniter or ZF. I know cakePHP have more helpful but I dont want see it in my website Thanks for support. On Feb 15, 11:05 am, Novice Programmer [EMAIL PROTECTED] wrote: if you define your own layout named default.thml in app/views/layouts then cake's default layout wont come. Thanks. On 2/14/08, seonet(tm) [EMAIL PROTECTED] wrote: Hello All, I am a newbie. I just try to learn Zend Framework and CodeIgniter. Now I want to learn CakePHP. I have a problem. When I try code in Controller, Model and View. My hello world project always have a default layout with some help (query, bendmark ...) from framework core. But I dont want to see this layout. I want to do it see like CodeIgniter or ZF. Mean see only Hello World on webpage. Plzz tell detail how to remove default layout. Thanks so much. [ sorry if my English is poor ] -- Thanks Regards, Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
why CSS don't work
Hello, I have a problem why CSS don't work? Below is my setup and system information. System OS:Fedora 8 Web server : Apache Apache :DocumentRoot is '/var/www/html/' Cakephp path: app: /var/www/html/ webroot : /var/www/html/app/webroot/ index.php file : '/var/www/html/' I copy 'Index.php' file to the '/var/www/html/' and setup the ROOT,APP_DIR and CAKE_CORE_INCLUDE_PATH constant variables.And below is the vale of them. define('ROOT',dirname(_FILE_)); define('APP_DIR','app'); define('CAKE_CORE_INCLUDE_PATH',ROOT); Below is my source code of view: ?php echo $html-css('de_main','import') ? ?php echo $html-css('de_votings','import') ? div class=votings h2Voting/h2 table class=nav cellpadding=0 cellspacing=0 tr style=text-align:left The path of de_main.css and de_votings.css is '/var/www/html/app/ webroo/css/'. (p.s.they are created by decorate) Cloud you tell me how i setup the path or something i need to do? 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 -~--~~~~--~~--~--~---
About CSS path problem
Hello, I have a problem why CSS don't work? Below is my setup and system information. System OS:Fedora 8 Web server : Apache Apache :DocumentRoot is '/var/www/html/' Cakephp path: app: /var/www/html/ webroot : /var/www/html/app/webroot/ index.php file : '/var/www/html/' I copy 'Index.php' file to the '/var/www/html/' and setup the ROOT,APP_DIR and CAKE_CORE_INCLUDE_PATH constant variables.And below is the vale of them. define('ROOT',dirname(_FILE_)); define('APP_DIR','app'); define('CAKE_CORE_INCLUDE_PATH',ROOT); Below is my source code of view: ?php echo $html-css('de_main','import') ? ?php echo $html-css('de_votings','import') ? div class=votings h2Voting/h2 table class=nav cellpadding=0 cellspacing=0 tr style=text-align:left The path of de_main.css and de_votings.css is '/var/www/html/app/ webroo/css/'. (p.s.they are created by decorate) Cloud you tell me how i setup the path or something i need to do? 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 -~--~~~~--~~--~--~---