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.7 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.7
      • 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:     /**
 29:      * The request object.
 30:      *
 31:      * @var \Cake\Http\ServerRequest
 32:      */
 33:     protected $_request;
 34: 
 35:     /**
 36:      * Constructor.
 37:      *
 38:      * @param \Cake\Http\ServerRequest $request The request object.
 39:      * @param array $context Context info.
 40:      */
 41:     public function __construct(ServerRequest $request, array $context)
 42:     {
 43:         $this->_request = $request;
 44:     }
 45: 
 46:     /**
 47:      * {@inheritDoc}
 48:      */
 49:     public function primaryKey()
 50:     {
 51:         return [];
 52:     }
 53: 
 54:     /**
 55:      * {@inheritDoc}
 56:      */
 57:     public function isPrimaryKey($field)
 58:     {
 59:         return false;
 60:     }
 61: 
 62:     /**
 63:      * {@inheritDoc}
 64:      */
 65:     public function isCreate()
 66:     {
 67:         return true;
 68:     }
 69: 
 70:     /**
 71:      * {@inheritDoc}
 72:      */
 73:     public function val($field)
 74:     {
 75:         return $this->_request->getData($field);
 76:     }
 77: 
 78:     /**
 79:      * {@inheritDoc}
 80:      */
 81:     public function isRequired($field)
 82:     {
 83:         return false;
 84:     }
 85: 
 86:     /**
 87:      * {@inheritDoc}
 88:      */
 89:     public function getRequiredMessage($field)
 90:     {
 91:         return null;
 92:     }
 93: 
 94:     /**
 95:      * {@inheritDoc}
 96:      */
 97:     public function getMaxLength($field)
 98:     {
 99:         return null;
100:     }
101: 
102:     /**
103:      * {@inheritDoc}
104:      */
105:     public function fieldNames()
106:     {
107:         return [];
108:     }
109: 
110:     /**
111:      * {@inheritDoc}
112:      */
113:     public function type($field)
114:     {
115:         return null;
116:     }
117: 
118:     /**
119:      * {@inheritDoc}
120:      */
121:     public function attributes($field)
122:     {
123:         return [];
124:     }
125: 
126:     /**
127:      * {@inheritDoc}
128:      */
129:     public function hasError($field)
130:     {
131:         return false;
132:     }
133: 
134:     /**
135:      * {@inheritDoc}
136:      */
137:     public function error($field)
138:     {
139:         return [];
140:     }
141: }
142: 
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