CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.6 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 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

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Namespace Core

Namespaces

  • Cake\Core\Configure
  • Cake\Core\Exception
  • Cake\Core\Retry
  • Cake\Core\TestSuite

Function Detail

deprecationWarning() ¶

deprecationWarning(string $message, int $stackFrame = 1): void

Helper method for outputting deprecation warnings

Parameters
string $message

The message to output as a deprecation warning.

int $stackFrame optional

The stack frame to include in the error. Defaults to 1 as that should point to application/plugin code.

Returns
void

env() ¶

env(string $key, string|bool|null $default = null): string|bool|null

Gets an environment variable from available sources, and provides emulation for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom environment information.

Parameters
string $key

Environment variable name.

string|bool|null $default optional

Specify a default value in case the environment variable is not defined.

Returns
string|bool|null
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#env

getTypeName() ¶

getTypeName(mixed $var): string

Returns the objects class or var type of it's not an object

Parameters
mixed $var

Variable to check

Returns
string

h() ¶

h(mixed $text, bool $double = true, string|null $charset = null): mixed

Convenience method for htmlspecialchars.

Parameters
mixed $text

Text to wrap through htmlspecialchars. Also works with arrays, and objects. Arrays will be mapped and have all their elements escaped. Objects will be string cast if they implement a __toString method. Otherwise, the class name will be used. Other scalar types will be returned unchanged.

bool $double optional

Encode existing html entities.

string|null $charset optional

Character set to use when escaping. Defaults to config value in mb_internal_encoding() or 'UTF-8'.

Returns
mixed
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#h

namespaceSplit() ¶

namespaceSplit(string $class): array<string>

Split the namespace from the classname.

Commonly used like list($namespace, $className) = namespaceSplit($class);.

Parameters
string $class

The full class name, ie Cake\Core\App.

Returns
array<string>

pj() ¶

pj(mixed $var): mixed

JSON pretty print convenience function.

In terminals this will act similar to using json_encode() with JSON_PRETTY_PRINT directly, when not run on CLI will also wrap <pre> tags around the output of given variable. Similar to pr().

This function returns the same variable that was passed.

Parameters
mixed $var

Variable to print out.

Returns
mixed
See Also
pr()
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#pj

pluginSplit() ¶

pluginSplit(string $name, bool $dotAppend = false, string|null $plugin = null): array

Splits a dot syntax plugin name into its plugin and class name. If $name does not have a dot, then index 0 will be null.

Commonly used like

list($plugin, $name) = pluginSplit($name);
Parameters
string $name

The name you want to plugin split.

bool $dotAppend optional

Set to true if you want the plugin to have a '.' appended to it.

string|null $plugin optional

Optional default plugin to use if no plugin is found. Defaults to null.

Returns
array
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#pluginSplit

pr() ¶

pr(mixed $var): mixed

print_r() convenience function.

In terminals this will act similar to using print_r() directly, when not run on CLI print_r() will also wrap <pre> tags around the output of given variable. Similar to debug().

This function returns the same variable that was passed.

Parameters
mixed $var

Variable to print out.

Returns
mixed
See Also
debug()
Links
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#pr

triggerWarning() ¶

triggerWarning(string $message): void

Triggers an E_USER_WARNING.

Parameters
string $message

The warning message.

Returns
void

Interfaces

  • ConsoleApplicationInterface

    An interface defining the methods that the console runner depend on.

  • ContainerApplicationInterface

    Interface for applications that configure and use a dependency injection container.

  • ContainerInterface

    Interface for the Dependency Injection Container in CakePHP applications

  • HttpApplicationInterface

    An interface defining the methods that the http server depend on.

  • PluginApplicationInterface

    Interface for Applications that leverage plugins & events.

  • PluginInterface

    Plugin Interface

Classes

  • App

    App is responsible for resource location, and path management.

  • BasePlugin

    Base Plugin Class

  • ClassLoader

    ClassLoader

  • Configure

    Configuration class. Used for managing runtime configuration information.

  • Container

    Dependency Injection container

  • ObjectRegistry

    Acts as a registry/factory for objects.

  • Plugin

    Plugin is used to load and locate plugins.

  • PluginCollection

    Plugin Collection

  • ServiceConfig

    Read-only wrapper for configuration data

  • ServiceProvider

    Container ServiceProvider

Traits

  • ConventionsTrait

    Provides methods that allow other classes access to conventions based inflections.

  • InstanceConfigTrait

    A trait for reading and writing instance config

  • StaticConfigTrait

    A trait that provides a set of static methods to manage configuration for classes that provide an adapter facade or need to have sets of configuration data registered and manipulated.

OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs