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

  • Arguments
  • Command
  • CommandCollection
  • CommandFactory
  • CommandRunner
  • ConsoleErrorHandler
  • ConsoleInput
  • ConsoleInputArgument
  • ConsoleInputOption
  • ConsoleInputSubcommand
  • ConsoleIo
  • ConsoleOptionParser
  • ConsoleOutput
  • Helper
  • HelperRegistry
  • HelpFormatter
  • Shell
  • ShellDispatcher
  • TaskRegistry

Interfaces

  • CommandCollectionAwareInterface
  • CommandFactoryInterface

Class HelpFormatter

HelpFormatter formats help for console shells. Can format to either text or XML formats. Uses ConsoleOptionParser methods to generate help.

Generally not directly used. Using $parser->help($command, 'xml'); is usually how you would access help. Or via the --help=xml option on the command line.

Xml output is useful for integration with other tools like IDE's or other build tools.

Namespace: Cake\Console
Location: Console/HelpFormatter.php

Properties summary

  • $_alias protected
    string
    Alias to display in the output.
  • $_maxArgs protected
    integer
    The maximum number of arguments shown when generating usage.
  • $_maxOptions protected
    integer
    The maximum number of options shown when generating usage.
  • $_parser protected
    Cake\Console\ConsoleOptionParser
    Option parser.

Method Summary

  • __construct() public
    Build the help formatter for an OptionParser
  • _generateUsage() protected

    Generate the usage for a shell based on its arguments and options. Usage strings favor short options over the long ones. and optional args will be indicated with []

  • _getMaxLength() protected
    Iterate over a collection and find the longest named thing.
  • setAlias() public
    Set the alias
  • text() public
    Get the help as formatted text suitable for output on the command line.
  • xml() public
    Get the help as an xml string.

Method Detail

__construct() public ¶

__construct( Cake\Console\ConsoleOptionParser $parser )

Build the help formatter for an OptionParser

Parameters
Cake\Console\ConsoleOptionParser $parser
The option parser help is being generated for.

_generateUsage() protected ¶

_generateUsage( )

Generate the usage for a shell based on its arguments and options. Usage strings favor short options over the long ones. and optional args will be indicated with []

Returns
string

_getMaxLength() protected ¶

_getMaxLength( array $collection )

Iterate over a collection and find the longest named thing.

Parameters
array $collection
The collection to find a max length of.
Returns
integer

setAlias() public ¶

setAlias( string $alias )

Set the alias

Parameters
string $alias
The alias
Throws
Cake\Console\Exception\ConsoleException
When alias is not a string.

text() public ¶

text( integer $width = 72 )

Get the help as formatted text suitable for output on the command line.

Parameters
integer $width optional 72
The width of the help output.
Returns
string

xml() public ¶

xml( boolean $string = true )

Get the help as an xml string.

Parameters
boolean $string optional true
Return the SimpleXml object or a string. Defaults to true.
Returns
string|SimpleXMLElement
See $string

Properties detail

$_alias ¶

protected string

Alias to display in the output.

'cake'

$_maxArgs ¶

protected integer

The maximum number of arguments shown when generating usage.

6

$_maxOptions ¶

protected integer

The maximum number of options shown when generating usage.

6

$_parser ¶

protected Cake\Console\ConsoleOptionParser

Option parser.

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