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

  • ArrayContext
  • ContextFactory
  • EntityContext
  • FormContext
  • NullContext

Interfaces

  • ContextInterface
  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         3.0.0
 13:  * @license       https://opensource.org/licenses/mit-license.php MIT License
 14:  */
 15: namespace Cake\View\Form;
 16: 
 17: use Cake\Http\ServerRequest;
 18: 
 19: /**
 20:  * Provides a context provider that does nothing.
 21:  *
 22:  * This context provider simply fulfils the interface requirements
 23:  * that FormHelper has and allows access to the request data.
 24:  */
 25: class NullContext implements ContextInterface
 26: {
 27:     /**
 28:      * The request object.
 29:      *
 30:      * @var \Cake\Http\ServerRequest
 31:      */
 32:     protected $_request;
 33: 
 34:     /**
 35:      * Constructor.
 36:      *
 37:      * @param \Cake\Http\ServerRequest $request The request object.
 38:      * @param array $context Context info.
 39:      */
 40:     public function __construct(ServerRequest $request, array $context)
 41:     {
 42:         $this->_request = $request;
 43:     }
 44: 
 45:     /**
 46:      * {@inheritDoc}
 47:      */
 48:     public function primaryKey()
 49:     {
 50:         return [];
 51:     }
 52: 
 53:     /**
 54:      * {@inheritDoc}
 55:      */
 56:     public function isPrimaryKey($field)
 57:     {
 58:         return false;
 59:     }
 60: 
 61:     /**
 62:      * {@inheritDoc}
 63:      */
 64:     public function isCreate()
 65:     {
 66:         return true;
 67:     }
 68: 
 69:     /**
 70:      * {@inheritDoc}
 71:      */
 72:     public function val($field)
 73:     {
 74:         return $this->_request->getData($field);
 75:     }
 76: 
 77:     /**
 78:      * {@inheritDoc}
 79:      */
 80:     public function isRequired($field)
 81:     {
 82:         return false;
 83:     }
 84: 
 85:     /**
 86:      * {@inheritDoc}
 87:      */
 88:     public function getRequiredMessage($field)
 89:     {
 90:         return null;
 91:     }
 92: 
 93:     /**
 94:      * {@inheritDoc}
 95:      */
 96:     public function getMaxLength($field)
 97:     {
 98:         return null;
 99:     }
100: 
101:     /**
102:      * {@inheritDoc}
103:      */
104:     public function fieldNames()
105:     {
106:         return [];
107:     }
108: 
109:     /**
110:      * {@inheritDoc}
111:      */
112:     public function type($field)
113:     {
114:         return null;
115:     }
116: 
117:     /**
118:      * {@inheritDoc}
119:      */
120:     public function attributes($field)
121:     {
122:         return [];
123:     }
124: 
125:     /**
126:      * {@inheritDoc}
127:      */
128:     public function hasError($field)
129:     {
130:         return false;
131:     }
132: 
133:     /**
134:      * {@inheritDoc}
135:      */
136:     public function error($field)
137:     {
138:         return [];
139:     }
140: }
141: 
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