Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Coisa estranha no session->flash()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pedro Valmor  
View profile   Translate to Translated (View Original)
 More options Nov 3, 2:55 pm
From: Pedro Valmor <pedroval...@gmail.com>
Date: Tue, 03 Nov 2009 17:55:42 -0200
Local: Tues, Nov 3 2009 2:55 pm
Subject: Coisa estranha no session->flash()
Olá,

Boa tarde a todos os desenvolvedores aew...

Estou setando o método da classe Session assim na action de um
Controller qqr:

function add(){
        $this->layout = 'Site';
        if (!empty($this->data)) {
            if ($this->Newsletter->save($this->data)) {
                $this->Session->setFlash('Adicionado!');
                $this->redirect(array('controller'=>'sites'
,'action'=>'index'));
            }
        }
    }

E depois na View recupero assim:

echo $session->flash();

Mas volta com um número inteiro "1", sempre fica abaixo da mensagem de
"Adicionado", alguém já passou por isso?

Ex:

<br/>
<div id="flashMessage" class="message">Adicionado!</div>
1
<br/>

inclusive acontece com todas as outras msgs que uso... como deletar,
atualizado, etc...  Alguém pode me ajudar por favor? Obrigado!

--

[]s

Pedro Valmor


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabriel Gilini  
View profile   Translate to Translated (View Original)
 More options Nov 6, 8:07 am
From: Gabriel Gilini <gabr...@usosim.com.br>
Date: Fri, 6 Nov 2009 11:07:03 -0200
Local: Fri, Nov 6 2009 8:07 am
Subject: Re: [CakePHP-Tuga] Coisa estranha no session->flash()
2009/11/3 Pedro Valmor <pedroval...@gmail.com>:

A função flash do SessionHelper já dá echo e retorna um booleano que
indica sucesso. O que tá acontecendo é que o echo faz uma conversão
implícita desse `true', e exibe "1" sempre que você chama a função :)

http://api.cakephp.org/class/session-helper#method-SessionHelperflash

--
Gabriel Gilini

www.usosim.com.br
gabr...@usosim.com.br


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pedro Barros de Miranda Sobrinho  
View profile   Translate to Translated (View Original)
 More options Nov 6, 7:07 am
From: Pedro Barros de Miranda Sobrinho <pedro...@gmail.com>
Date: Fri, 6 Nov 2009 10:07:47 -0200
Local: Fri, Nov 6 2009 7:07 am
Subject: Re: [CakePHP-Tuga] Coisa estranha no session->flash()

Amigo tira o "echo"!

Use apenas <? $session->flash('flash');?>

Pedro

2009/11/3 Pedro Valmor <pedroval...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pedro Valmor  
View profile   Translate to Translated (View Original)
 More options Nov 6, 8:18 am
From: Pedro Valmor <pedroval...@gmail.com>
Date: Fri, 06 Nov 2009 11:18:11 -0200
Local: Fri, Nov 6 2009 8:18 am
Subject: Re: [CakePHP-Tuga] Re: Coisa estranha no session->flash()
Obrigado!

[]s

Pedro Valmor

Gabriel Gilini escreveu:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mauro George  
View profile   Translate to Translated (View Original)
 More options Nov 6, 2:51 pm
From: Mauro George <mauro...@gmail.com>
Date: Fri, 6 Nov 2009 11:51:54 -0800 (PST)
Local: Fri, Nov 6 2009 2:51 pm
Subject: Re: Coisa estranha no session->flash()
Ola, eu sou novo no cakePHP e aqui na comunidade também.
Já segui alguns tutoriais, estou entendo a lógica do cake e tal.
No entanto, o setFlah nunca exibe nada na minha view, fiz o exemplo
igual do tutorial do blog do proprio cake. A operação funciona,
adicionar, exculir..., no entanto o flash não.

Alguem sabe o motivo? Tem que colocar algo na view do default.ctp, ou
criar uma view.ctp?

On 6 nov, 11:07, Gabriel Gilini <gabr...@usosim.com.br> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago de Oliveira  
View profile   Translate to Translated (View Original)
 More options Nov 7, 12:38 am
From: Thiago de Oliveira <thiago.ho...@gmail.com>
Date: Sat, 7 Nov 2009 03:38:20 -0200
Local: Sat, Nov 7 2009 12:38 am
Subject: Re: [CakePHP-Tuga] Re: Coisa estranha no session->flash()

*
*
Olá Gabriel!

Estou com o mesmo problema, esse 1 senvergonha tava me dexando loco

Sou mais um fam teu!

brigadão

2009/11/6 Gabriel Gilini <gabr...@usosim.com.br>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mauro George  
View profile   Translate to Translated (View Original)
 More options Nov 8, 12:03 pm
From: Mauro George <mauro...@gmail.com>
Date: Sun, 8 Nov 2009 09:03:14 -0800 (PST)
Local: Sun, Nov 8 2009 12:03 pm
Subject: Re: Coisa estranha no session->flash()
Estou passando pelo mesmo problema. Sou iniciante no CakePHP e nem
sabia como exibir o SetFlash na view. Agora estou exbindo e faço assim
e( $session->flash() ); no entanto no inicio não estava o numero 1 lá
ou eu não reparei mais agora esta aparecendo exatamente como você
falou:

<div id="flashMessage" class="message">Comentário Salvo!</div>
1

Sera que algum sabe resolver?

On 3 nov, 17:55, Pedro Valmor <pedroval...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mauro George  
View profile   Translate to Translated (View Original)
 More options Nov 8, 12:10 pm
From: Mauro George <mauro...@gmail.com>
Date: Sun, 8 Nov 2009 09:10:24 -0800 (PST)
Local: Sun, Nov 8 2009 12:10 pm
Subject: Re: Coisa estranha no session->flash()
Obrigado Gabriel estava com a mesma duvida e fui pesquisar, resumindo
não necessita dar echo $session->flash(); e sim $session->flash();.
Achei na url abaixo

http://stackoverflow.com/questions/1402912/cakephp-flash-messages-dis...

Um abraço e obrigado

On 6 nov, 11:07, Gabriel Gilini <gabr...@usosim.com.br> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google