Are you starting Zend_Layout without passing it any parameters? Do you give it the path to your layout scripts? Do you set a layout script to render?

Also, do you have any empty image tags in your site that might be calling <img src=""> on your site? If so, that might be pulling up your index again and increasing the counter.

More details please :)
ralph

Dylan Arnold wrote:
Hi all,

I just downloaded the latest snapshot to try out Zend_Layout.

I've come across something a little strange. I noticed one of my db queries was executing twice after a post to a certain action.

Can anybody explain what is going on?

I added this to the index action of my index controller to try and figure out what was going on.

$session = new Zend_Session_Namespace('test');
$session->counter = $session->counter + 1 ;
echo 'Count: ' . $session->counter;

Simple counter right? Adds one each time you visit /index/index.
It is until i add Zend_Layout::startMvc(); to my bootstrap.

As soon as I do that. If i visit http://localhost/index/index the counter works as expected adding one each time. If I visit http://localhost/index/index/ (With a slash on the end) the counter increments by TWO.

Am I missing something here?

Thanks







Reply via email to