CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • BreadcrumbsHelper
  • FlashHelper
  • FormHelper
  • HtmlHelper
  • NumberHelper
  • PaginatorHelper
  • RssHelper
  • SessionHelper
  • TextHelper
  • TimeHelper
  • UrlHelper

Traits

  • IdGeneratorTrait
  • SecureFieldTokenTrait
 1: <?php
 2: /**
 3:  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 4:  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 5:  *
 6:  * Licensed under The MIT License
 7:  * For full copyright and license information, please see the LICENSE.txt
 8:  * Redistributions of files must retain the above copyright notice.
 9:  *
10:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11:  * @link          https://cakephp.org CakePHP(tm) Project
12:  * @since         1.1.7
13:  * @license       https://opensource.org/licenses/mit-license.php MIT License
14:  */
15: namespace Cake\View\Helper;
16: 
17: use Cake\View\Helper;
18: use Cake\View\View;
19: 
20: /**
21:  * Session Helper.
22:  *
23:  * Session reading from the view.
24:  *
25:  * @link https://book.cakephp.org/3.0/en/views/helpers/session.html
26:  * @deprecated 3.0.2 Use request->session() instead.
27:  */
28: class SessionHelper extends Helper
29: {
30:     /**
31:      * Constructor
32:      *
33:      * @param \Cake\View\View $View The View this helper is being attached to.
34:      * @param array $config Configuration settings for the helper.
35:      */
36:     public function __construct(View $View, array $config = [])
37:     {
38:         deprecationWarning(
39:             'SessionHelper is deprecated and will be removed in 4.0.0. ' .
40:             'Use request->session() instead.'
41:         );
42: 
43:         parent::__construct($View, $config);
44:     }
45: 
46:     /**
47:      * Reads a session value for a key or returns values for all keys.
48:      *
49:      * In your view:
50:      * ```
51:      * $this->Session->read('Controller.sessKey');
52:      * ```
53:      * Calling the method without a param will return all session vars
54:      *
55:      * @param string|null $name The name of the session key you want to read
56:      * @return mixed Values from the session vars
57:      */
58:     public function read($name = null)
59:     {
60:         return $this->_View->getRequest()->getSession()->read($name);
61:     }
62: 
63:     /**
64:      * Checks if a session key has been set.
65:      *
66:      * In your view:
67:      * ```
68:      * $this->Session->check('Controller.sessKey');
69:      * ```
70:      *
71:      * @param string $name Session key to check.
72:      * @return bool
73:      */
74:     public function check($name)
75:     {
76:         return $this->_View->getRequest()->getSession()->check($name);
77:     }
78: 
79:     /**
80:      * Event listeners.
81:      *
82:      * @return array
83:      */
84:     public function implementedEvents()
85:     {
86:         return [];
87:     }
88: }
89: 
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs