Welcome.
I have a strange situation because my Yii framework itself generates links for logged off and put it in the body of view of each element (span, div, li and other)
By this problem, on every click in the body of the view I get logged off
To generate view i used $this->render();
In result DOM look like this:
<section class="top-line">
<div class="right">
<a href="/workflow/?r=user/logout"> </a>
</div>
<a href="/workflow/?r=user/logout"> </a>
</section>
<a href="/workflow/?r=user/logout">
<div class="main-box">...</div>
</a>
<footer>
<a href="/workflow/?r=user/logout"> </a>
<div class="container">..</div>
</footer>
@DarkMukke Include layouts/main.php:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="shortcut icon" href="<?php echo Yii::app()->request->baseUrl; ?>/favicon.ico" type="image/x-icon" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="<?php echo baseUrl(); ?>/css/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="<?php echo baseUrl(); ?>/css/print.css" media="print" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?php echo baseUrl(); ?>/css/ie.css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="<?php echo baseUrl(); ?>/css/form.css" />
<link rel="stylesheet" type="text/css" href="<?php echo baseUrl(); ?>/css/blue/style.css" />
<?php
$cs = cs();
$cssCoreUrl = $cs->getCoreScriptUrl();
$cs->registerCssFile($cssCoreUrl . '/jui1.9.2/css/base/jquery-ui.css');
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
$cs->registerCoreScript('cookie');
$cs->registerScriptFile('js/block.js');
$cs->registerScriptFile('js/global.js');
$cs->registerScriptFile('css/blue/style.js');
?>
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>
<header class="top">
<div class="container">
<div class="logo">
<h1><a href="<?php echo Yii::app()->baseUrl; ?>" ><?php echo CHtml::encode(Yii::app()->name); ?></a></h1>
</div>
<nav>
<?php $this->widget('Menu'); ?>
</nav>
</div>
</header>
<section class="top-line">
<div class="container">
<?php if (isset($this->breadcrumbs)): ?>
<div class="left">
<?php
$this->widget('zii.widgets.CBreadcrumbs', array(
'links' => $this->breadcrumbs,
));
?>
</div>
<?php endif ?>
<?php if (Yii::app()->user->isGuest == false): ?>
<div class="right">
<a href="<?php echo url('/user/logout'); ?>"><?php echo t('Logout') . ' (' . Yii::app()->user->name . ')'; ?>
</div>
<?php endif; ?>
</div>
</section>
<div class="main-box">
<div class="container clear">
<div class="clear cenetr">
<?php
foreach (Yii::app()->user->getFlashes() as $key => $message) {
echo '<div class="flash-' . $key . '">' . $message . " <span class=\"close-flush-btn\"></span></div>\n";
}
?>
</div>
</div>
<div class="wrapper">
<?php echo $content; ?>
</div>
</div>
<footer>
<div class="container">
<div class="wrapper">
<div class="fleft"><?php echo Yii::app()->params['copyrightInfo']; ?></div>
<div class="fright"><?php echo Yii::powered(); ?></div>
</div>
</div>
</footer>
</body>
Has anyone had this problem? Which may result from such conduct.
[Solved] My stupid mistake. Do not shut a tag in logout link and body react on every click. What a shame .. Thanks for your interest.
you have you main-box inside your tag
use this as last 3 lines there, otherwise every click on main-box willt rigger the element