Re: Loop + save() = Problema do mau

2007-10-19 Thread hostdesigner
Caras eu realmente estou pra desistir... Advinha só eu fiz usando save() sem informar o ID e ele fez dois inserts e atualizou o resto _ Fiz também usando create() (como você citou) e tchan tchan tchan, MALDITO não fez nada, nem inseriu, nem atualizou muito menos removeu... Que porr@ :D

Re: Loop + save() = Problema do mau

2007-10-19 Thread Rafael Barbosa
Tenta trocar o exit por break =) On 10/19/07, hostdesigner [EMAIL PROTECTED] wrote: Bom, a quem se interessar (se é que alguém está lendo isso...) Eu estava fazendo uns testes baseados em POGramação avançada (poe gambiarra nisso), e percebi que o loop do foreach esta realmente rodando duas

Re: Loop + save() = Problema do mau

2007-10-19 Thread hostdesigner
Já tentei break, exit, die inclusive return (nem faz sentido, mas, tentei...) O problema é que não funciona mesmo dependendo da quantidade de registros retornados pela consulta de $this-Question- findAll() os calculos ficam errados... No final das contas quando não falta um registro adiciona 1

Re: Loop + save() = Problema do mau

2007-10-19 Thread hostdesigner
Bom, a quem se interessar (se é que alguém está lendo isso...) Eu estava fazendo uns testes baseados em POGramação avançada (poe gambiarra nisso), e percebi que o loop do foreach esta realmente rodando duas vezes, ainda não descobri por que, mas... $researchNum = $this-Research-getNumRows();

Re: Loop + save() = Problema do mau

2007-10-19 Thread hostdesigner
Esqueci para executar o método é só acessar http://aplicacao/admin/perguntas/aplicar/1/1 vai executar o mesmo que eu estou fazendo aqui na minha máquina. Falopa! --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do

Re: Loop + save() = Problema do mau

2007-10-19 Thread Marcio Trindade
Designer, eu não entendi direito mas se vc precisa pegar um registro do banco e grava-lo novamente com id diferente vc pode fazer isso facilmente, mas não da forma q vc citou. ERRADO $this-MODEL-save( array( 'campo' = 'valores' ) ); $this-MODEL-create(); O certo seria você pegar o registro,

Re: pretty-print (indent) view output

2007-10-19 Thread McFadly
meant to include this link as well: http://jennifermadden.com/scripts/ViewRenderedSource.html On Oct 19, 1:11 am, McFadly [EMAIL PROTECTED] wrote: http://www.thinkingphp.org/2006/10/11/basic-cakephp-templating-skills/ scroll to The line break issue On Oct 18, 11:08 pm, Wayne Fay [EMAIL

Re: pretty-print (indent) view output

2007-10-19 Thread McFadly
http://www.thinkingphp.org/2006/10/11/basic-cakephp-templating-skills/ scroll to The line break issue On Oct 18, 11:08 pm, Wayne Fay [EMAIL PROTECTED] wrote: If you file a bug, perhaps someone in the Cake Dev team will implement it. But this seems to be a low priority enhancement to me.

Re: Form manipulation

2007-10-19 Thread 2000Man
I figured out the problem: the key set in the form is not the same as the one in the Session.Somehow the latter one get's generated again somewhere. I have added some logging throughout the system and this is wat happens: 2007-10-19 10:16:36 Error: Dispatcher::start(Forumposts) 2007-10-19

Re: Email component (1.2) fails to send attachment and content

2007-10-19 Thread luke BAKING barker
hmm looking more closely at mine, I actually get a weird error. My layout is rendering, asHTML in the email, but the view is not. However - in the original (show original as I am looking at in GMail) the view HTML does show. I havent included anything weird, but I wonder if there is some missing

Re: select box validation in CakaPHP 1.2

2007-10-19 Thread manuj bansal
i didnt get your code you want select option then why r you going thru input function try it *view code echo $form-label('modelname.name') echo $form-select('modelname.name',array('value'='text')); echo $form-error('it can't be blank');

Where do the templates for default views live -- not the ones in the scaffolds dir

2007-10-19 Thread loki_mdog
I want bake.php to create my controller with default actions baked in (index, edit, add, etc) and I want bake.php to create my views for these actions as well. All works great. I want to change the template it uses for say the index so I can add something to all index.thtml files that are

About a mysql query

2007-10-19 Thread [EMAIL PROTECTED]
Hey, I am trying to do this: $this-set('announcements', $this-Announcement-findAll(null, array('id', 'name','SUBSTRING_INDEX(content, , 20) AS teaser', 'pic_filename'), 'add_date DESC')); and it doesn't work properly .. here is part of the dump of the resulting object: array(2) {

Passing information from an iframe to the parent node using php

2007-10-19 Thread DonGato
Hi there! I've been working a few weeks with cakephp, I'm really happy with the framework and the results, I've been developing a personal project and I'm stuck at the point where I have an iframe inside one of my pages, so I need to click in a button inside the iframe and make the iframe info

Re: Problem with bake

2007-10-19 Thread Wayne Fay
RTFM :-) http://dev.mysql.com/doc/refman/5.0/en/gone-away.html Wayne On 10/19/07, Conrad [EMAIL PROTECTED] wrote: I am having the same problems - in trying to create controller for 'user' . I get the message 1. DESCRIBE `users` 2006: MySQL server has gone away BUT the controller is

Re: admin routing question

2007-10-19 Thread AD7six
On Oct 20, 1:03 am, rtconner [EMAIL PROTECTED] wrote: Does anyone know, is there a way to code the following behavior typinghttp://site.com/adminrouteinto the browser will render a 404 then i set up apache to directhttp://admin.site.comto point to the admintroute folder and this is

Re: Problem with bake

2007-10-19 Thread Conrad
I am having the same problems - in trying to create controller for 'user' . I get the message 1. DESCRIBE `users` 2006: MySQL server has gone away BUT the controller is written. in trying to create views I get this (index.thtml)

Re: Where do the templates for default views live -- not the ones in the scaffolds dir

2007-10-19 Thread loki_mdog
So I did some more searching and found that there are no templates for this stuff...The files are generated straight out of bake.php...Views are created by a method called: __bakeViews Hope this helps someone else. -- View this message in context:

Re: want to update more than one fields in one query

2007-10-19 Thread manuj bansal
i wanted to update more than one rows in database table by one query only in cakephp for eg we can use deleteall to delete more than one field at one query On Oct 20, 12:26 am, Wayne Fay [EMAIL PROTECTED] wrote: You'll have a lot more luck on this list if you carefully (and fully) explain

Re: ACO Numeric Alias not working for ACL-allow

2007-10-19 Thread uolax
So here was my solution. Because it is a numeric value, I need to set the foreign_id to exactly match the alias. I then setParent to a permission group and all works great. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Prevent Cake 1.2 from auto inserting 0000-00-00 00:00:00 into input fields

2007-10-19 Thread RLR
Thanks for your reply Nate but the default value is defined as NULL e.g. `recurring_date` datetime default NULL, Any other suggestions? On Oct 19, 9:32 pm, nate [EMAIL PROTECTED] wrote: Change the default value of the column to NULL. On Oct 19, 3:10 pm, RLR [EMAIL PROTECTED] wrote: I

Re: Prevent Cake 1.2 from auto inserting 0000-00-00 00:00:00 into input fields

2007-10-19 Thread nate
Change the default value of the column to NULL. On Oct 19, 3:10 pm, RLR [EMAIL PROTECTED] wrote: I recently started using cakephp 1.2 branch. The problem I am having is that a date field in my app is always saved/ reloaded with -00-00 00:00:00. I would prefer to use a NULL value when

Re: ACO Numeric Alias not working for ACL-allow

2007-10-19 Thread uolax
It seems to be throwing an error here: $obj['Aro'] = $Aro-find($Aro-_resolveID($aro)); on line 277 of db_acl.php. The numeric value is discarded. Hmm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

ACO Numeric Alias not working for ACL-allow

2007-10-19 Thread uolax
Hey All, Has anyone experienced any bugs using ACL when the ARO alias is purely numeric? When I use $this-Acl-allow('380010', 'courses/add'); I get a node error: Warning: DB_ACL::allow() - Invalid node in... but when I use $this-Acl-allow('a380010', 'courses/add'); all works out okay. Should I

Re: want to update more than one fields in one query

2007-10-19 Thread Wayne Fay
You'll have a lot more luck on this list if you carefully (and fully) explain what you have vs what you want in complete English sentences. Wayne On 10/19/07, manuj bansal [EMAIL PROTECTED] wrote: i want to update and add more than one fields in one query in cakephp1.2 becuse it is running

admin routing question

2007-10-19 Thread rtconner
Does anyone know, is there a way to code the following behavior typing http://site.com/adminroute into the browser will render a 404 then i set up apache to direct http://admin.site.com to point to the admintroute folder and this is where the admin stie would reside. thanks, rob

Looking for Bakers

2007-10-19 Thread James Archer
Hey guys, we're looking for some talented bakers who can jump in on an in-progress social networking application and help us push it to completion. There's plenty of work available for anyone who knows what they're doing and can work in a professional way. :-) You can find out more about our

Components, Controllers y Elements

2007-10-19 Thread Pinholecam
I've been looking for some answers to my problems but after a couple of hours of searching, I'll answer that. a) I would need to query differents models form a component. How to do it? b) Looking at the manual it seems that each model has one controller and one controller has one model. In

Re: File upload handling in cakephp 1.2

2007-10-19 Thread Samuel DeVore
you need to look at how the file is sent to the controler, you still have to read in the actual file from the temp location and decide what you are going to do with it. There is a lot of 'magic' but you still need to do _some_ work On 10/19/07, Indian Baker [EMAIL PROTECTED] wrote: Hi, I too

select box validation in CakaPHP 1.2

2007-10-19 Thread senser
Hi there! I'm trying to write a code for displaying a select box with several options (tax years for example) and I have to validate the data passed by that select box. I want the user to must select an option from the list. Here is the code from view file where I populate the box using

Re: problem in validation due to loop in view file

2007-10-19 Thread manuj bansal
i am working in cakephp1.2 **Model Code*** my view code is like this $i=0; foreach($rows as row) { $i++ echo

Re: File upload handling in cakephp 1.2

2007-10-19 Thread Indian Baker
Hi, I too had a similar problem but when I try to put the $form-create('User', array('action' = 'upload', 'type='file')); I get this error, which doesn't happen when I remove the 'type'='file' option.. but then the file actually doesn't upload even though the record gets added to the

Re: ACL Admin plugin AD7six No User Model

2007-10-19 Thread confuzus
bparise helped me out with this - just issue loadmodels or some such business in the plugin controller. On Oct 16, 5:09 am, AD7six [EMAIL PROTECTED] wrote: I seem to remember that there was a change in cake which prevents Plugins from accessing app models, this change post-dates the last

URL routing

2007-10-19 Thread Aroha
I am trying to figure out how to make the root folder redirect to a page rather than the typical controller/action. I am attempting a small CMS and would like to have friendly URLs. I would like to have the controller be used if one is available, but if there is not a controller which matches the

download doc file with cake

2007-10-19 Thread marek. bytnar
Cake puts some characters which destroy .doc structure when downloading. Here is an analogic function which works ok in plain php script function download_doc_file($id = null) { $this-autoRender = false; $file = APP.rtf/.$id./cv.doc; $basename = basename($file);

Re: Email component (1.2) fails to send attachment and content

2007-10-19 Thread luke BAKING barker
Hi Francky, I just had a similar bit of difficulty getting this going. I don't think it is a bug though, there were a coupe of things: 1) I had an absoulte filepath for my $attachment; but you must specify a filepath (look at the email.php code to see -- if there are no filepaths it won't

How to use different arrayconditions on the same field.

2007-10-19 Thread Niels Riber
Hi, Are there a way to use the same field multiple times in arrayconditions? The problem is that you have to use the same arraykey again which of course is impossible. An example is when I want to get all articles between two given dates like this. $this-Article-findAll(array(

Newbie question re URLs

2007-10-19 Thread jakeone
I'm confused. Why do URLs in Cake typically point to controller/ action and not view/action? I would have thought a link was presenting something to the user, i.e. a view, not an action. The Cake manual's blog tutorial has a link as follows: echo $html-link('Add Post', '/posts/add'); and

Re: pretty-print (indent) view output

2007-10-19 Thread Rex
Hi Wayne, I agree that this is a low-priority requirement, but it is very useful for development. I am aware of several ways of tidying HTML both at server side or client side. But it doesn't look nice that cake's HTML generator generates such untidy output. If it has to generate HTML, let it

Prevent Cake 1.2 from auto inserting 0000-00-00 00:00:00 into input fields

2007-10-19 Thread RLR
I recently started using cakephp 1.2 branch. The problem I am having is that a date field in my app is always saved/ reloaded with -00-00 00:00:00. I would prefer to use a NULL value when no date has been entered. How can I change/fix this behavior? Thanks

want to update more than one fields in one query

2007-10-19 Thread manuj bansal
i want to update and add more than one fields in one query in cakephp1.2 becuse it is running many queries at at time in one bye one thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Embedded cake apps?

2007-10-19 Thread Arne-Kolja Bachstein
Hi there, is it possible to use Cake for an embeddable web application? I have to write a small application that will get embedded into an existing web site, e.g. by including the bootstrap file at some point of the original web sites source. Of course I know I can do this, but what about

Re: homepage with CakePHP (newbie question)

2007-10-19 Thread Wayne Fay
This doesn't seem like something that Cake should help you with. Instead, add a job that runs after your cron shell that calculates those things and inserts them into a 4th table in your database. Then build a Cake view on top of that new table. Wayne On 10/19/07, Eric [EMAIL PROTECTED] wrote:

Re: ACL Admin plugin AD7six No User Model

2007-10-19 Thread confuzus
bparise helped me get around this problem by using loadmodel in the plugin controller. On Oct 16, 5:09 am, AD7six [EMAIL PROTECTED] wrote: On Oct 15, 9:03 pm, seacloud9 [EMAIL PROTECTED] wrote: I have followed the following instructions: 1) Extract all files into your app folder directory.

File uploading using 1

2007-10-19 Thread Indian Baker
Hi, I'm referring to the following excellent link to try and do a file upload, http://groups.google.com/group/cake-php/browse_thread/thread/be474455e24cbdb8/b7da5f84de301619?lnk=gstq=file+upload+1.2%2B+chris#b7da5f84de301619 Now the problem is, if I do t a regular Form post in my view like ?php

Re: Email component (1.2) fails to send attachment and content

2007-10-19 Thread francky06l
Well guys, I had to tweak it..But since yesterday, form the branch it seems better ...I can send mails with attachments with the original component... However there is one case a bit ennoying (not really a problem), but if you send a mail as html without attachment..it display a warning about my

Re: Problem with bake

2007-10-19 Thread Conrad
Of which none appys the mysql server is working fine for all other applications On Oct 19, 5:59 pm, Wayne Fay [EMAIL PROTECTED] wrote: RTFM :-)http://dev.mysql.com/doc/refman/5.0/en/gone-away.html Wayne On 10/19/07, Conrad [EMAIL PROTECTED] wrote: I am having the same problems - in

Re: Embedded cake apps?

2007-10-19 Thread Arne-Kolja Bachstein
Hi again, I found something that could help me, so if there's anyone who is able to tell me if this could work, please talk to me :-) In the 15 minutes blog tutorial (found at http://manual.cakephp.org/appendix/blog_tutorial) there's mentioned the following: If you don't want or can't get

Re: Combining Conditions in query's with findAll()

2007-10-19 Thread BoSc
You're right, in Cake lingo this is called HABTM, in normal database ERD's they both have a Has Many relationship with eachother ofcourse I have modeled this with HABTM, but thanks for your correction! Your solution to the order problem is 'spot on', actually what I was looking for! I didn't

Installing CakePHP in XAMP environment... no style

2007-10-19 Thread Comida411
Hi I installed XAMP on XP (all went well, got XAMP home page and activated security) I installed cakePHP 1.2 1. modified .htacess file to contain RewriteBase /cake 2. modified httpd.config to AllowOverride all But still my CakePHP home page has no styles...Why.. what did I fail to do...

Re: Combining Conditions in query's with findAll()

2007-10-19 Thread Amit Badkas
If you have author's id then to find all books for that author ordered/sorted by categories, you can also do, Category-findAll(Book.author_id = $author_id, null, 'Category.name ASC'); On 10/19/07, BoSc [EMAIL PROTECTED] wrote: You're right, in Cake lingo this is called HABTM, in normal

homepage with CakePHP (newbie question)

2007-10-19 Thread Eric
Hey guys, I have just started using CakePhp, and I have a trouble to find how to manage my idea. So, here is the principle: I have 3 tables updates on a daily basis by cron shell from another software. I would like to have a homepage in my CakePhp site, showing me statistics like : last date

Re: Newbie question re URLs

2007-10-19 Thread Wayne Fay
To put it simply, there is magic happening that you don't see. If you don't call it yourself in the Controller method, $this-render() is called for you. Other magic finds the correct view name to use based on the action name (though you can override this to specify an alternate) and which layout

Non Cake app in a cake domain

2007-10-19 Thread darkblack
hi, Cake has been setup in the root and the main application runs out of cake. But there is a forum set at www.site.com/forum which has existing forum running. But since cake is set up in the root, it wouldn't allow access to www.site.com/forum and throws a controller error. How do i set up a

select box validation in CakaPHP 1.2

2007-10-19 Thread senser
Hi there! I'm trying to write a code for displaying a select box with several options (tax years for example) and I have to validate the data passed by that select box. I want the user to must select an option from the list. Here is the code from view file where I populate the box using