Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Implement Phalcon\Flash\Session::isset(). #1342

Closed
temuri416 opened this issue Oct 7, 2013 · 10 comments
Closed

[NFR] Implement Phalcon\Flash\Session::isset(). #1342

temuri416 opened this issue Oct 7, 2013 · 10 comments

Comments

@temuri416
Copy link
Contributor

Currently, I can do this in a controller:

$this->flashSession->message('postData', $this->request->getPost());

This will populate $_SESSION['_flashMessages']['postData'] with contents of $_POST.

Implement Phalcon\Flash\Session::isset():

/**
 * @var Phalcon\Flash\Session
 */
$flash = $this->di['flashSession'];
if ($flash->isset('postData')) {
    $postData = $flash->getMessages('postData')
}

Thank you!

@dreamsxin
Copy link
Contributor

Why do such a thing to use flashsession? Queues may be more meet your needs.
Like Quickhash, @sjinks you see.

@temuri416
Copy link
Contributor Author

Sorry, I don't quite understand what you mean. Can you provide a code snippet?

@dreamsxin
Copy link
Contributor

Can direct use of the session, According to the description of the document \phalcon\flash not suitable for to do it.

        $this->session->set("postData", $this->request->getPost());

        if ($this->session->has("postData")) {
            $postData = $this->session->get("postData");
            $this->session->remove("postData");
        }

@temuri416
Copy link
Contributor Author

I wanted to use ->flashsession because it auto-removes message once it's been accessed. I could certainly do it manually with ->session, but..... I am lazy :-) And it's not a bad method to have in API.

You disagree?

@dreamsxin
Copy link
Contributor

I am also very lazy :) Let \Phalcon\Session implementation automatically deleted, how?

@temuri416
Copy link
Contributor Author

So, what's the verdict?

@ghost
Copy link

ghost commented Oct 8, 2013

I'll try to implement it once I fix the other bugs :-)

@ghost
Copy link

ghost commented Oct 17, 2013

@temuri416 Could you please check if it works for you?

@temuri416
Copy link
Contributor Author

Sure, I'll do that soon as I get a free minute.

... and while I have your attention - could you please comment on #1367 NFR, please let me know what you think.

Thanks a lot.

@phalcon
Copy link
Collaborator

phalcon commented Oct 19, 2013

Implemented in 1.3.0

@phalcon phalcon closed this as completed Oct 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants