<?php $randId = \Core\CString::rand(); echo \Core\View::includeResources("resources/core/jquery/jquery-1.11.3.min.js"); ?> <div class="login"> <trans>You are logged as</trans> <?php echo \Core\Security::UserName(); ?> | <a href="#" id="logout_<?php echo $randId; ?> "><trans>logout</trans></a> </div> <script type="text/javascript"> $(function() { // Edit link $("#logout_<?php echo $randId; ?> ").click(function() { $.ajax({ url: "<?php echo APP_URI . "index.php/" . \Core\Request::getClassUri($self) . "/logout"; ?> /", method : "POST", data : { "moduleId" : "<?php echo $self->id();