Re: setFlash() doesn't wotk with me on WAMP

2010-12-20 Thread Ahmed Abdulmoula
I am using mine Layout


On Mon, Dec 20, 2010 at 1:00 PM, Amit Badkas amit.sanis...@gmail.comwrote:

 Hi,

 The controller code seems to be fine. Are you using CakePHP's built-in
 layout or your own?

 Amit Badkas

 PHP Applications for E-Biz: http://www.sanisoft.com



 On Mon, Dec 20, 2010 at 12:52 PM, Ahmed - CakePHP 
 ahmed.amo...@gmail.comwrote:


 This is the Controller code:

 ?php
 class PostsController extends AppController {
var $name = 'Posts';
var $helpers = array('Session','Html','Form');
var $components = array('Session');

function index() {
$this-set('posts', $this-Post-find('all', array('order'
 =
 array('id DESC';
}

function add() {
if (!empty($this-data)) {
$this-Post-create();
if ($this-Post-save($this-data)) {
$this-Session-setFlash('The post has been added
 successfully.');
$this-reDirect(array('action' = 'index'));
} else {
$this-Session-setFlash('The post has not been
 added
 successfullt');
}
}
}
 }
 ?


 On Dec 20, 10:02 am, Amit Badkas amit.sanis...@gmail.com wrote:
  Hi,
 
  Have you followed the blog tutorial exactly? If you can show me the code
  written by you, that would be helpful to go ahead to solve the problem.
 
  Amit Badkas
 
  PHP Applications for E-Biz:http://www.sanisoft.com
 
  On Mon, Dec 20, 2010 at 12:18 PM, Ahmed - CakePHP 
 ahmed.amo...@gmail.comwrote:
 
 
 
   Any help here ?!?!?!
 
   On Dec 19, 10:07 am, Ahmed - CakePHP ahmed.amo...@gmail.com wrote:
You said:
Make sure you have declared both the Session Component and the
Session Helper in your app_controller.
 
How to do that ?!?!
What shill I do exactly Jeremy ?
 
On Dec 19, 12:27 am, Jeremy Burns | Class Outfit
 
jeremybu...@classoutfit.com wrote:
 Make sure you have declared both the Session Component and the
 Session
   Helper in your app_controller. setFlash only places the message into
 the
   session. To show it, use echo $this-Session-flash() in a view,
 element or
   layout.
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.comhttp://www.classoutfit.com
 
 On 18 Dec 2010, at 16:13, Ahmed - CakePHP wrote:
 
  Hello,
 
  I am very very very new on CakePHP.
  I tried to do a blog using the CakePHP. I did it :).
  but I found a problem:
  when I want to use $this-Session-setFlash(Write whatever);
 
  it doesn't work.
  I don't see the sentences that I write inside setFlash. They
 doesn't
  occur when I run the code/functions.
 
  I am using the local server WAMP
 
  Can you please tell me what is the problem ?
 
  Regards,
  Ahmed
 
  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
   others with their CakePHP related questions.
 
  You received this message because you are subscribed to the
 Google
   Groups CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor
 more options, visit this group athttp://
   groups.google.com/group/cake-php?hl=en
 
   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
 others
   with their CakePHP related questions.
 
   You received this message because you are subscribed to the Google
 Groups
   CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor
 more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site 

Re: setFlash() doesn't wotk with me on WAMP

2010-12-20 Thread Ahmed Abdulmoula
Thank you Jeremy


On Mon, Dec 20, 2010 at 1:14 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 How are you writing out the session message in the view? I t ought to be:
 echo $this-Session-flash();

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 20 Dec 2010, at 10:11, Ahmed Abdulmoula wrote:


 I am using mine Layout


 On Mon, Dec 20, 2010 at 1:00 PM, Amit Badkas amit.sanis...@gmail.comwrote:

 Hi,

 The controller code seems to be fine. Are you using CakePHP's built-in
 layout or your own?

 Amit Badkas

 PHP Applications for E-Biz: http://www.sanisoft.com



 On Mon, Dec 20, 2010 at 12:52 PM, Ahmed - CakePHP ahmed.amo...@gmail.com
  wrote:


 This is the Controller code:

 ?php
 class PostsController extends AppController {
var $name = 'Posts';
var $helpers = array('Session','Html','Form');
var $components = array('Session');

function index() {
$this-set('posts', $this-Post-find('all', array('order'
 =
 array('id DESC';
}

function add() {
if (!empty($this-data)) {
$this-Post-create();
if ($this-Post-save($this-data)) {
$this-Session-setFlash('The post has been added
 successfully.');
$this-reDirect(array('action' = 'index'));
} else {
$this-Session-setFlash('The post has not been
 added
 successfullt');
}
}
}
 }
 ?


 On Dec 20, 10:02 am, Amit Badkas amit.sanis...@gmail.com wrote:
  Hi,
 
  Have you followed the blog tutorial exactly? If you can show me the
 code
  written by you, that would be helpful to go ahead to solve the problem.
 
  Amit Badkas
 
  PHP Applications for E-Biz:http://www.sanisoft.com
 
  On Mon, Dec 20, 2010 at 12:18 PM, Ahmed - CakePHP 
 ahmed.amo...@gmail.comwrote:
 
 
 
   Any help here ?!?!?!
 
   On Dec 19, 10:07 am, Ahmed - CakePHP ahmed.amo...@gmail.com wrote:
You said:
Make sure you have declared both the Session Component and the
Session Helper in your app_controller.
 
How to do that ?!?!
What shill I do exactly Jeremy ?
 
On Dec 19, 12:27 am, Jeremy Burns | Class Outfit
 
jeremybu...@classoutfit.com wrote:
 Make sure you have declared both the Session Component and the
 Session
   Helper in your app_controller. setFlash only places the message into
 the
   session. To show it, use echo $this-Session-flash() in a view,
 element or
   layout.
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.comhttp://www.classoutfit.com
 
 On 18 Dec 2010, at 16:13, Ahmed - CakePHP wrote:
 
  Hello,
 
  I am very very very new on CakePHP.
  I tried to do a blog using the CakePHP. I did it :).
  but I found a problem:
  when I want to use $this-Session-setFlash(Write
 whatever);
 
  it doesn't work.
  I don't see the sentences that I write inside setFlash. They
 doesn't
  occur when I run the code/functions.
 
  I am using the local server WAMP
 
  Can you please tell me what is the problem ?
 
  Regards,
  Ahmed
 
  Check out the new CakePHP Questions
 sitehttp://cakeqs.organdhelp
   others with their CakePHP related questions.
 
  You received this message because you are subscribed to the
 Google
   Groups CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor
 more options, visit this group athttp://
   groups.google.com/group/cake-php?hl=en
 
   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
 others
   with their CakePHP related questions.
 
   You received this message because you are subscribed to the Google
 Groups
   CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor
 more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en



 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received