Re: How do I redirect?

2012-03-21 Thread AD7six


On Tuesday, 20 March 2012 18:15:44 UTC+1, glevine wrote:

 In case anyone really cares, it was failing because the debugger was 
 outputting warnings about changing the salt and cipherSeed configs. 


The point of my message was to highlight that's the case - and that the 
first reply you received (2 hours after you posted originally) should also 
have led you to the same conclusion. As such, the rest of the thread is 
mostly noise.

Evidently though the meaning of my message was not understood, the 
intention was literally to get you to re-read that first reply.

I'm not actually debugging with the code that I wrote above.



It's a good idea to post slimmed down code, but it has to actually work 
unless it's a pseudo-code example. It's a really bad idea to 
post fundamentally wrong code that you aren't using and haven't tested - it 
will often, as is the case here, lead people to focus on problems with your 
example rather than the problem you're actually looking at.

AD 



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread AD7six


On Tuesday, 20 March 2012 02:41:51 UTC+1, glevine wrote:

 @thatsgreat2345 That was just a typo.

 Commenting out the print statements in the change method has no effect. I 
 never see the in the index print statement and the browser simply shows a 
 blank page with a couple of warnings about changing the salt and cipherSeed.


 Read this aloud You can not send output to the webpage and then redirect.

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread pokerphp


 Also never do any output from the controller. If you still want to make it 
 nasty use something like 

  

  public function index()  {$nasty = 'in the index';$this-set('nasty', 
$nasty);  }

then in the View/Tests/index.ctp
?php
  print $nasty;
?

this will be way better than printing directly from the controller.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread euromark
i sure hope its not the same guy:
http://stackoverflow.com/questions/9763280/cakephp-2-0-upgrade-shell-redirect-faulty
 
same time, same crazy idea

guys. if you want to crappy debug here, use DIE();

die('before redirect');
$this-redirect(array('controller' = 'test', 'action' = 'index'));
die('after redirect'); // totally nonsense, because it will NEVER reach 
this point


echo creates problems - and doesnt solve any!

if you want to NOT crappy debug with redirects, use something else, like 
log():

$this-log('some log entry', 'test');

and look into /tmp/logs/test.log




Am Dienstag, 20. März 2012 11:23:29 UTC+1 schrieb pokerphp:

 Also never do any output from the controller. If you still want to make it 
 nasty use something like 

  

   public function index()  {$nasty = 'in the index';
 $this-set('nasty', $nasty);  }

 then in the View/Tests/index.ctp
 ?php
   print $nasty;
 ?

 this will be way better than printing directly from the controller.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread glevine
AD7six,

Initially, I had a print statement before the redirect left over from when 
I was tracing the code path down to the header() call. After commenting out 
all print statements except the one in index(), I still don't successfully 
redirect. That print statement shouldn't be called until after the redirect 
has occurred. So unless you can explain why any output from index() would 
have an affect on the redirect, I think we can do without the condescending 
tone. Thanks

On Tuesday, March 20, 2012 3:22:36 AM UTC-4, AD7six wrote:



 On Tuesday, 20 March 2012 02:41:51 UTC+1, glevine wrote:

 @thatsgreat2345 That was just a typo.

 Commenting out the print statements in the change method has no effect. I 
 never see the in the index print statement and the browser simply shows a 
 blank page with a couple of warnings about changing the salt and cipherSeed.


  Read this aloud You can not send output to the webpage and then 
 redirect.

 AD


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread glevine
Fair enough. My example was only to show that I was having trouble with 
reaching certain points in the code. I didn't want to write a lot of code 
for an example that didn't need to be overly complex to get the point 
across.

On Tuesday, March 20, 2012 6:23:29 AM UTC-4, pokerphp wrote:

 Also never do any output from the controller. If you still want to make it 
 nasty use something like 

  

   public function index()  {$nasty = 'in the index';
 $this-set('nasty', $nasty);  }

 then in the View/Tests/index.ctp
 ?php
   print $nasty;
 ?

 this will be way better than printing directly from the controller.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread glevine
euromark,

No that stackoverflow post is not me. As I said previously, I'm not 
actually debugging with the code that I wrote above. I just posted an 
extremely rudimentary and flawed example to see if there was something 
outside of common sense that I was missing. The code I'm debugging doesn't 
print anywhere inside the method where the redirect happens. What's in 
index() shouldn't have any affect. If you must know, I have nothing in my 
index() method at the moment. I just want to see the url change, which it's 
not.

On Tuesday, March 20, 2012 8:43:35 AM UTC-4, euromark wrote:

 i sure hope its not the same guy:

 http://stackoverflow.com/questions/9763280/cakephp-2-0-upgrade-shell-redirect-faulty
  
 same time, same crazy idea

 guys. if you want to crappy debug here, use DIE();

 die('before redirect');
 $this-redirect(array('controller' = 'test', 'action' = 'index'));
 die('after redirect'); // totally nonsense, because it will NEVER reach 
 this point


 echo creates problems - and doesnt solve any!

 if you want to NOT crappy debug with redirects, use something else, like 
 log():

 $this-log('some log entry', 'test');

 and look into /tmp/logs/test.log




 Am Dienstag, 20. März 2012 11:23:29 UTC+1 schrieb pokerphp:

 Also never do any output from the controller. If you still want to make 
 it nasty use something like 

  

   public function index()  {$nasty = 'in the index';
 $this-set('nasty', $nasty);  }

 then in the View/Tests/index.ctp
 ?php
   print $nasty;
 ?

 this will be way better than printing directly from the controller.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread glevine
In case anyone really cares, it was failing because the debugger was 
outputting warnings about changing the salt and cipherSeed configs. So that 
was the output that was being printed before the redirect which was giving 
me issues. Obviously I should have just taken care to do that sooner, but I 
was being lazy and assuming that problem was with my code and not the 
CakePHP library. Live 'n' learn.

On Sunday, March 18, 2012 10:28:02 PM UTC-4, glevine wrote:

 I have the following code:

 class TestsController extends AppController
 {
   public function index()
   {
 print 'in the index';
   }

   public function change()
   {
 print 'before redirect';
 $this-redirect(array('controller' = 'test', 'action' = 'index'));
 print 'after redirect';
   }
 }
  

 When I visit www.mysite.com/test/change/ I get a page with before 
 redirect and the URL is still 
 www.mysite.com/test/change/.http://www.mysite.com/test/change/I don't get 
 after redirect or in the index. What am I doing wrong?

 Thanks


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-20 Thread euromark
and for more details on the subject see
http://kb2.adobe.com/community/publishing/505/cpsid_50572.html 


Am Dienstag, 20. März 2012 18:15:44 UTC+1 schrieb glevine:

 In case anyone really cares, it was failing because the debugger was 
 outputting warnings about changing the salt and cipherSeed configs. So that 
 was the output that was being printed before the redirect which was giving 
 me issues. Obviously I should have just taken care to do that sooner, but I 
 was being lazy and assuming that problem was with my code and not the 
 CakePHP library. Live 'n' learn.

 On Sunday, March 18, 2012 10:28:02 PM UTC-4, glevine wrote:

 I have the following code:

 class TestsController extends AppController
 {
   public function index()
   {
 print 'in the index';
   }

   public function change()
   {
 print 'before redirect';
 $this-redirect(array('controller' = 'test', 'action' = 'index'));
 print 'after redirect';
   }
 }
  

 When I visit www.mysite.com/test/change/ I get a page with before 
 redirect and the URL is still 
 www.mysite.com/test/change/.http://www.mysite.com/test/change/I don't get 
 after redirect or in the index. What am I doing wrong?

 Thanks



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread thatsgreat2345
You can not send output to the webpage and then redirect.

On Sunday, March 18, 2012 7:28:02 PM UTC-7, glevine wrote:

 I have the following code:

 class TestsController extends AppController
 {
   public function index()
   {
 print 'in the index';
   }

   public function change()
   {
 print 'before redirect';
 $this-redirect(array('controller' = 'test', 'action' = 'index'));
 print 'after redirect';
   }
 }
  

 When I visit www.mysite.com/test/change/ I get a page with before 
 redirect and the URL is still 
 www.mysite.com/test/change/.http://www.mysite.com/test/change/I don't get 
 after redirect or in the index. What am I doing wrong?

 Thanks


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread Milina Udara
can we do some process after redirect.(Not printion)

On Mon, Mar 19, 2012 at 11:37 AM, thatsgreat2345
thatsgreat2...@gmail.comwrote:

 You can not send output to the webpage and then redirect.


 On Sunday, March 18, 2012 7:28:02 PM UTC-7, glevine wrote:

 I have the following code:

 class TestsController extends AppController
 {
   public function index()
   {
 print 'in the index';
   }

   public function change()
   {
 print 'before redirect';
 $this-redirect(array('**controller' = 'test', 'action' = 'index'));
 print 'after redirect';
   }
 }


 When I visit www.mysite.com/test/change/ I get a page with before
 redirect and the URL is still 
 www.mysite.com/test/change/.http://www.mysite.com/test/change/I don't get 
 after redirect or in the index. What am I doing wrong?

 Thanks

  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread euromark
no you can't! or: you really shoudn't
you should simply do everything before redirecting.

theoretically, you can manually call exit() if you set the exit param to 
false on redirect.
but to me this makes no sense.


 can we do some process after redirect.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread glevine
Right, so in the example I was mainly just wanting to show that I was 
reaching those points in the code. Theoretically, if I remove the print 
'before redirect'; statement then I should never see after redirect but 
I should see in the index upon the new page load (since that is post 
redirect).

For some reason, I was still unable to redirect when I wasn't printing to 
the screen before the call to exit. However, I may have just been tired and 
didn't realize I still had a print before exit. So I'll try again and 
respond back with the results.

Thanks

On Monday, March 19, 2012 7:56:28 AM UTC-4, euromark wrote:

 no you can't! or: you really shoudn't
 you should simply do everything before redirecting.

 theoretically, you can manually call exit() if you set the exit param to 
 false on redirect.
 but to me this makes no sense.


  can we do some process after redirect.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread Brian Bowler
Please do I have the exact same problem and would like to know if you get
this fixed.

On Mon, Mar 19, 2012 at 10:56 AM, glevine levine.g...@gmail.com wrote:

 Right, so in the example I was mainly just wanting to show that I was
 reaching those points in the code. Theoretically, if I remove the print
 'before redirect'; statement then I should never see after redirect but
 I should see in the index upon the new page load (since that is post
 redirect).

 For some reason, I was still unable to redirect when I wasn't printing to
 the screen before the call to exit. However, I may have just been tired and
 didn't realize I still had a print before exit. So I'll try again and
 respond back with the results.

 Thanks


 On Monday, March 19, 2012 7:56:28 AM UTC-4, euromark wrote:

 no you can't! or: you really shoudn't
 you should simply do everything before redirecting.

 theoretically, you can manually call exit() if you set the exit param to
 false on redirect.
 but to me this makes no sense.


  can we do some process after redirect.

   --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread thatsgreat2345
Your problem is you are redirecting to test controller when in fact you 
should be redirecting to tests controller.

$this-redirect(array('controller' = 'tests', 'action' = 'index'));



On Monday, March 19, 2012 7:56:09 AM UTC-7, glevine wrote:

 Right, so in the example I was mainly just wanting to show that I was 
 reaching those points in the code. Theoretically, if I remove the print 
 'before redirect'; statement then I should never see after redirect but 
 I should see in the index upon the new page load (since that is post 
 redirect).

 For some reason, I was still unable to redirect when I wasn't printing to 
 the screen before the call to exit. However, I may have just been tired and 
 didn't realize I still had a print before exit. So I'll try again and 
 respond back with the results.

 Thanks

 On Monday, March 19, 2012 7:56:28 AM UTC-4, euromark wrote:

 no you can't! or: you really shoudn't
 you should simply do everything before redirecting.

 theoretically, you can manually call exit() if you set the exit param to 
 false on redirect.
 but to me this makes no sense.


  can we do some process after redirect.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread glevine
@thatsgreat2345 That was just a typo.

Commenting out the print statements in the change method has no effect. I 
never see the in the index print statement and the browser simply shows a 
blank page with a couple of warnings about changing the salt and 
cipherSeed. The url in the location bar remains 
http://www.example.com/tests/change.

On Monday, March 19, 2012 3:53:44 PM UTC-4, thatsgreat2345 wrote:

 Your problem is you are redirecting to test controller when in fact you 
 should be redirecting to tests controller.

 $this-redirect(array('controller' = 'tests', 'action' = 'index'));



 On Monday, March 19, 2012 7:56:09 AM UTC-7, glevine wrote:

 Right, so in the example I was mainly just wanting to show that I was 
 reaching those points in the code. Theoretically, if I remove the print 
 'before redirect'; statement then I should never see after redirect but 
 I should see in the index upon the new page load (since that is post 
 redirect).

 For some reason, I was still unable to redirect when I wasn't printing to 
 the screen before the call to exit. However, I may have just been tired and 
 didn't realize I still had a print before exit. So I'll try again and 
 respond back with the results.

 Thanks

 On Monday, March 19, 2012 7:56:28 AM UTC-4, euromark wrote:

 no you can't! or: you really shoudn't
 you should simply do everything before redirecting.

 theoretically, you can manually call exit() if you set the exit param to 
 false on redirect.
 but to me this makes no sense.


  can we do some process after redirect.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect?

2012-03-19 Thread thatsgreat2345
First off, change your core configuration so you aren't using the default 
salt and cipherSeed (this can be found in your apps core.php file in the 
Config folder), that is if this app matters which it seems like it is just 
a practice app but still good practice.
It appears your routes(app Config folder, routes.php) are set so that when 
you visit your tests index it will direct you towards the default home page 
that is set in the cake core.
I recommend modifying this, so that when people visit your index (/) it is 
routed to the controller and action of your choice. Which in this case 
seems to be tests controller and action index. 
The line of code will look like this
Router::connect('/', array('controller' = 'pages', 'action' = 'display', 
'home'));
Modify it to
Router::connect('/', array('controller' = 'tests', 'action' = 'index');
For the record, it is not recommended to use print when debugging, if you 
just want to do browser debugging use cakes debug function. You can use it 
anywhere, and it accepts any type of variable and will output it cleanly.

On Monday, March 19, 2012 6:41:51 PM UTC-7, glevine wrote:

 @thatsgreat2345 That was just a typo.

 Commenting out the print statements in the change method has no effect. I 
 never see the in the index print statement and the browser simply shows a 
 blank page with a couple of warnings about changing the salt and 
 cipherSeed. The url in the location bar remains 
 http://www.example.com/tests/change.

 On Monday, March 19, 2012 3:53:44 PM UTC-4, thatsgreat2345 wrote:

 Your problem is you are redirecting to test controller when in fact you 
 should be redirecting to tests controller.

 $this-redirect(array('controller' = 'tests', 'action' = 'index'));



 On Monday, March 19, 2012 7:56:09 AM UTC-7, glevine wrote:

 Right, so in the example I was mainly just wanting to show that I was 
 reaching those points in the code. Theoretically, if I remove the print 
 'before redirect'; statement then I should never see after redirect but 
 I should see in the index upon the new page load (since that is post 
 redirect).

 For some reason, I was still unable to redirect when I wasn't printing 
 to the screen before the call to exit. However, I may have just been tired 
 and didn't realize I still had a print before exit. So I'll try again and 
 respond back with the results.

 Thanks

 On Monday, March 19, 2012 7:56:28 AM UTC-4, euromark wrote:

 no you can't! or: you really shoudn't
 you should simply do everything before redirecting.

 theoretically, you can manually call exit() if you set the exit param 
 to false on redirect.
 but to me this makes no sense.


  can we do some process after redirect.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How do I redirect from an element

2008-06-17 Thread francky06l

If you want to render a new view when searching, you should not use
ajax but normal submit, then the complete view will be rendered ...
Maybe I misunderstood the problem.
hth

On Jun 17, 6:26 am, Shahzad [EMAIL PROTECTED] wrote:
 Thank you very much for you reply. Though I have solved the problem by
 putting some javascript code in my ctp file and setting a variable in
 my controller. But this seems a bit unprofessional to me. Let me try
 to rephrase my problem:

 I have an element search.ctp. I have included it ($this-element) in
 my default layout (so it will appear on every page). I have a search
 button (and there is a search action in my controller). Based on the
 search word (provided by the user input) I will have to search the
 database and fetch the matching result and then display the results in
 another view (not an element) result.ctp. If I use the redirect from
 my controller action then this will display the result.ctp within the
 search element (I don't want that). I want to render the new view
 altogether.

 Thank you.

 On Jun 6, 10:06 pm, b logica [EMAIL PROTECTED] wrote:

  One doesn't redirect from anelement. I think what you mean is that
  you have a form submit button and that clicking it results in some new
  layout elements being added asynchronously to the search div. Do you
  have some javascript code attached to the form to get the results
  using XHR / AJAX? If so, you need to modify the search method in the
  controller to keep it from rendering a layout:

  $this-layout = false;

  Also, have a look at the RequestHandler component.

  On Fri, Jun 6, 2008 at 2:33 AM, Shahzad [EMAIL PROTECTED] wrote:

   I have anelementsearch.ctp, it has a simple text box and a search
   button. When ever I press the search button and try toredirect(from
   my controller action), It displays the redirected page with in the
  element. What am I doing wrong? How do Iredirectthe whole page?

   Thank you
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I redirect from an element

2008-06-17 Thread Shahzad

Thanks franky. I think this is the way to go.

On Jun 17, 11:46 am, francky06l [EMAIL PROTECTED] wrote:
 If you want to render a new view when searching, you should not use
 ajax but normal submit, then the complete view will be rendered ...
 Maybe I misunderstood the problem.
 hth

 On Jun 17, 6:26 am, Shahzad [EMAIL PROTECTED] wrote:

  Thank you very much for you reply. Though I have solved the problem by
  putting some javascript code in my ctp file and setting a variable in
  my controller. But this seems a bit unprofessional to me. Let me try
  to rephrase my problem:

  I have anelementsearch.ctp. I have included it ($this-element) in
  my default layout (so it will appear on every page). I have a search
  button (and there is a search action in my controller). Based on the
  search word (provided by the user input) I will have to search the
  database and fetch the matching result and then display the results in
  another view (not anelement) result.ctp. If I use theredirectfrom
  my controller action then this will display the result.ctp within the
  searchelement(I don't want that). I want to render the new view
  altogether.

  Thank you.

  On Jun 6, 10:06 pm, b logica [EMAIL PROTECTED] wrote:

   One doesn't redirect from anelement. I think what you mean is that
   you have a form submit button and that clicking it results in some new
   layout elements being added asynchronously to the search div. Do you
   have some javascript code attached to the form to get the results
   using XHR / AJAX? If so, you need to modify the search method in the
   controller to keep it from rendering a layout:

   $this-layout = false;

   Also, have a look at the RequestHandler component.

   On Fri, Jun 6, 2008 at 2:33 AM, Shahzad [EMAIL PROTECTED] wrote:

I have anelementsearch.ctp, it has a simple text box and a search
button. When ever I press the search button and try toredirect(from
my controller action), It displays the redirected page with in the
   element. What am I doing wrong? How do Iredirectthe whole page?

Thank you
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I redirect from an element

2008-06-17 Thread Shahzad

Thanks franky. I think this is the way to go.

On Jun 17, 11:46 am, francky06l [EMAIL PROTECTED] wrote:
 If you want to render a new view when searching, you should not use
 ajax but normal submit, then the complete view will be rendered ...
 Maybe I misunderstood the problem.
 hth

 On Jun 17, 6:26 am, Shahzad [EMAIL PROTECTED] wrote:

  Thank you very much for you reply. Though I have solved the problem by
  putting some javascript code in my ctp file and setting a variable in
  my controller. But this seems a bit unprofessional to me. Let me try
  to rephrase my problem:

  I have anelementsearch.ctp. I have included it ($this-element) in
  my default layout (so it will appear on every page). I have a search
  button (and there is a search action in my controller). Based on the
  search word (provided by the user input) I will have to search the
  database and fetch the matching result and then display the results in
  another view (not anelement) result.ctp. If I use theredirectfrom
  my controller action then this will display the result.ctp within the
  searchelement(I don't want that). I want to render the new view
  altogether.

  Thank you.

  On Jun 6, 10:06 pm, b logica [EMAIL PROTECTED] wrote:

   One doesn't redirect from anelement. I think what you mean is that
   you have a form submit button and that clicking it results in some new
   layout elements being added asynchronously to the search div. Do you
   have some javascript code attached to the form to get the results
   using XHR / AJAX? If so, you need to modify the search method in the
   controller to keep it from rendering a layout:

   $this-layout = false;

   Also, have a look at the RequestHandler component.

   On Fri, Jun 6, 2008 at 2:33 AM, Shahzad [EMAIL PROTECTED] wrote:

I have anelementsearch.ctp, it has a simple text box and a search
button. When ever I press the search button and try toredirect(from
my controller action), It displays the redirected page with in the
   element. What am I doing wrong? How do Iredirectthe whole page?

Thank you
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I redirect from an element

2008-06-06 Thread b logica

One doesn't redirect from an element. I think what you mean is that
you have a form submit button and that clicking it results in some new
layout elements being added asynchronously to the search div. Do you
have some javascript code attached to the form to get the results
using XHR / AJAX? If so, you need to modify the search method in the
controller to keep it from rendering a layout:

$this-layout = false;

Also, have a look at the RequestHandler component.

On Fri, Jun 6, 2008 at 2:33 AM, Shahzad [EMAIL PROTECTED] wrote:

 I have an element search.ctp, it has a simple text box and a search
 button. When ever I press the search button and try to redirect (from
 my controller action), It displays the redirected page with in the
 element. What am I doing wrong? How do I redirect the whole page?

 Thank you

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---