国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

I can't get the session value in symfony2 from the ueditor in the plug-in.
阿神
阿神 2017-05-16 16:44:49
0
2
575

symfony2 action里面 $session = $this->getRequest()->getSession(); $session->set('companyId', 1);

ueditor php文件 sessionstart(); echo $SESSION['companyId'];

阿神
阿神

閉關(guān)修行中......

reply all(2)
PHPzhong

sf2 encapsulates session, you don’t need to adjust session_start:

// 頁(yè)面一:
$session = $this->getRequest()->getSession();
$session->set('key', 1);

// 頁(yè)面二:
$session = $this->getRequest()->getSession();
echo $session->get('key');

Update:

If you want to use it alone, make sure your session key is valid in the cookie, adjust $session->start() yourself, and use $session->get('xxx') to get variables, do not use php There are native methods in it, and the Session class has encapsulated all of them.

洪濤

In Symfony, Session exists in the Request object. In the controller, write this:

public funciton demoAction(Request $request)
{
    // 不需要 $session->start()
    $session = $request->getSession();
    $session->set('test', 'test value');
    
    var_dump($session->get('test'));
}

However, the components in Symfony can be used alone. As the topic mentioned by the subject, they can be used alone in the ueditor editor:

use Symfony\Component\HttpFoundation\Session\Session;

$session = new Session();
// 需要 $session->start();
$session->start();
$session->set('test', 'test value');

var_dump($session->get('test'));

Using Symfony components alone requires the use of autoload.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template