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
      • Exception
      • Formatter
      • Middleware
      • Parser
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class Package

Message Catalog

Namespace: Cake\I18n

Property Summary

  • $fallback protected
    string|null

    The name of a fallback package to use when a message key does not exist.

  • $formatter protected
    string

    The name of the formatter to use when formatting translated messages.

  • $messages protected
    array<array|string>

    Message keys and translations in this package.

Method Summary

  • __construct() public

    Constructor.

  • addMessage() public

    Adds one message for this package.

  • addMessages() public

    Adds new messages for this package.

  • getFallback() public

    Gets the fallback package name.

  • getFormatter() public

    Gets the formatter name for this package.

  • getMessage() public

    Gets the message of the given key for this package.

  • getMessages() public

    Gets the messages for this package.

  • setFallback() public

    Sets the fallback package name.

  • setFormatter() public

    Sets the formatter name for this package.

  • setMessages() public

    Sets the messages for this package.

Method Detail

__construct() ¶ public

__construct(string $formatter = 'default', string|null $fallback = null, array<array|string> $messages = [])

Constructor.

Parameters
string $formatter optional

The name of the formatter to use.

string|null $fallback optional

The name of the fallback package to use.

array<array|string> $messages optional

The messages in this package.

addMessage() ¶ public

addMessage(string $key, array|string $message): void

Adds one message for this package.

Parameters
string $key

the key of the message

array|string $message

the actual message

Returns
void

addMessages() ¶ public

addMessages(array<array|string> $messages): void

Adds new messages for this package.

Parameters
array<array|string> $messages

The messages to add in this package.

Returns
void

getFallback() ¶ public

getFallback(): string|null

Gets the fallback package name.

Returns
string|null

getFormatter() ¶ public

getFormatter(): string

Gets the formatter name for this package.

Returns
string

getMessage() ¶ public

getMessage(string $key): array|string|false

Gets the message of the given key for this package.

Parameters
string $key

the key of the message to return

Returns
array|string|false

getMessages() ¶ public

getMessages(): array<array|string>

Gets the messages for this package.

Returns
array<array|string>

setFallback() ¶ public

setFallback(string|null $fallback): void

Sets the fallback package name.

Parameters
string|null $fallback

The fallback package name.

Returns
void

setFormatter() ¶ public

setFormatter(string $formatter): void

Sets the formatter name for this package.

Parameters
string $formatter

The formatter name for this package.

Returns
void

setMessages() ¶ public

setMessages(array<array|string> $messages): void

Sets the messages for this package.

Parameters
array<array|string> $messages

The messages for this package.

Returns
void

Property Detail

$fallback ¶ protected

The name of a fallback package to use when a message key does not exist.

Type
string|null

$formatter ¶ protected

The name of the formatter to use when formatting translated messages.

Type
string

$messages ¶ protected

Message keys and translations in this package.

Type
array<array|string>
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