How to pass value from view to controller without using anchor tag and forms in Zend Framework 2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pass value from view to controller without using anchor tag and forms in Zend Framework 2

smsadhana.k
Used session in my page but expected output not coming for me.i am using ZendSkeletonApplication and ZfcUser

in view/done.phtml

$sessionContainer = new \Zend\Session\Container('myNameSpace');

$checking="Got it";

$sessionContainer->myVar = $checking;

In Controller/UserController.php

public function doneAction()

{
    $result=$this->getRequest()->getPost();
    $sessionContainer = new \Zend\Session\Container('myNameSpace');
    $confirmation=$sessionContainer->myVar;
    print_r($confirmation);
    return new ViewModel();
}


Please help me
Reply | Threaded
Open this post in threaded view
|

Re: How to pass value from view to controller without using anchor tag and forms in Zend Framework 2

graphicmist
This post has NOT been accepted by the mailing list yet.
I think setting of session in view is logically incorrect