Logout method don't work, help needed

Notice: This thread is very old.
ms31864
Member | 6
+
0
-

What is the best way to deal with logout?

Can anyone help me with this, I tried to add into my latte file but it doesn't work <?php <a n:href=“Login:actionOut”>Sign Out</a> ?>.

Thank you

CZechBoY
Member | 3608
+
0
-

You have to implement actionActionOut method in LoginPresenter.
You can take code from sandbox
https://github.com/…resenter.php#L46

ms31864
Member | 6
+
0
-

Yes but how to call that method in my latte file or how is the best way to do that in my latte file?

Thanks for support

ms31864
Member | 6
+
0
-

I forgot to tell you I had that method implemented with that code like in the sandbox but it doesn't work just calling it so in the latte file.

CZechBoY
Member | 3608
+
0
-

What mean “call in latte file”?
You create link to that action and click in web browser. Then you are logged out.

ms31864
Member | 6
+
0
-

Here is how ti looks into my latte file <li><a n:href="Login:actionOut">Sign Out</a></li> and my LoginPresent has this method that does this

<?php
	public function actionOut()
	{
		$this->getUser()->logout();
		$this->redirect('in');
	}
?>
petr.jirous
Member | 128
+
+2
-

<a n:href="Login:out">Sign out</a>

ms31864
Member | 6
+
0
-

Sorry I'm young in Nette but this method does not exist in my Presenter so how will that work, and also I have another question is there any good resource for English tutorial.

Thanks

CZechBoY
Member | 3608
+
+1
-

You can read english documentation.
Href to out means that actionOut and renderOut will be called in presenter (if they exists of course).

ms31864
Member | 6
+
0
-

Thanks man that worked for me