Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Component
  • Container
  • RecursiveComponentIterator

Interfaces

  • IComponent
  • IContainer

Traits

  • ArrayAccess
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class Component

Component is the base class for all components.

Components are objects implementing IComponent. They has parent component and own name.

Nette\ComponentModel\Component implements Nette\ComponentModel\IComponent uses Nette\SmartObject

Direct known subclasses

Nette\ComponentModel\Container, Nette\Forms\Controls\BaseControl

Indirect known subclasses

Nette\Application\UI\Component, Nette\Application\UI\Control, Nette\Forms\Controls\CsrfProtection, Nette\Forms\Controls\HiddenField, Nette\Forms\Controls\ImageButton, Nette\Forms\Controls\MultiChoiceControl, Nette\Forms\Controls\MultiSelectBox, Nette\Forms\Controls\RadioList, Nette\Forms\Controls\SelectBox, Nette\Forms\Controls\SubmitButton, Nette\Forms\Controls\TextArea, Nette\Forms\Controls\TextBase, Nette\Application\UI\Form, Nette\Forms\Controls\TextInput, Nette\Forms\Controls\UploadControl, Nette\Forms\Form, Nette\Application\UI\Multiplier, Nette\Application\UI\Presenter, Nette\Forms\Container, Nette\Forms\Controls\Button, Nette\Forms\Controls\Checkbox, Nette\Forms\Controls\CheckboxList, Nette\Forms\Controls\ChoiceControl
Abstract
Namespace: Nette\ComponentModel
Located at ComponentModel/Component.php
Methods summary
public
# __construct( )
public Nette\ComponentModel\IComponent|null
# lookup( string|null $type, boolean $throw = true )

Finds the closest ancestor specified by class or interface name.

Finds the closest ancestor specified by class or interface name.

Parameters

$type
$throw

Returns

Nette\ComponentModel\IComponent|null
IComponent|null
public string|null
# lookupPath( string|null $type = null, boolean $throw = true )

Finds the closest ancestor specified by class or interface name and returns backtrace path. A path is the concatenation of component names separated by self::NAME_SEPARATOR.

Finds the closest ancestor specified by class or interface name and returns backtrace path. A path is the concatenation of component names separated by self::NAME_SEPARATOR.

Parameters

$type
$throw

Returns

string|null
string|null
final public
# monitor( string $type, callable $attached = null, callable $detached = null )

Starts monitoring of ancestors.

Starts monitoring of ancestors.

Parameters

$type
$attached
$detached
public
# unmonitor( string $type )

Stops monitoring of ancestors.

Stops monitoring of ancestors.

Parameters

$type
protected
# attached( Nette\ComponentModel\IComponent $obj )

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.

Deprecated

use monitor($type, $attached)

Parameters

$obj
protected
# detached( Nette\ComponentModel\IComponent $obj )

This method will be called before the component (or component's parent) becomes detached from a monitored object. Do not call this method yourself.

This method will be called before the component (or component's parent) becomes detached from a monitored object. Do not call this method yourself.

Deprecated

use monitor($type, null, $detached)

Parameters

$obj
public string|null
# getName( )

Returns

string|null
string|null

Implementation of

Nette\ComponentModel\IComponent::getName()
public Nette\ComponentModel\IContainer|null
# getParent( )

Returns the parent container if any.

Returns the parent container if any.

Returns

Nette\ComponentModel\IContainer|null
IContainer|null

Implementation of

Nette\ComponentModel\IComponent::getParent()
public Nette\ComponentModel\Component
# setParent( Nette\ComponentModel\IContainer $parent = null, $name = null )

Sets or removes the parent of this component. This method is managed by containers and should not be called by applications

Sets or removes the parent of this component. This method is managed by containers and should not be called by applications

Parameters

$parent
$name
$name

Returns

Nette\ComponentModel\Component
static

Throws

Nette\InvalidStateException
Nette\InvalidStateException

Internal

Implementation of

Nette\ComponentModel\IComponent::setParent()
protected
# validateParent( Nette\ComponentModel\IContainer $parent )

Is called by a component when it is about to be set new parent. Descendant can override this method to disallow a parent change by throwing an Nette\InvalidStateException

Is called by a component when it is about to be set new parent. Descendant can override this method to disallow a parent change by throwing an Nette\InvalidStateException

Throws

Nette\InvalidStateException
Nette\InvalidStateException
public
# __clone( )

Object cloning.

Object cloning.

public
# __sleep( )

Prevents serialization.

Prevents serialization.

public
# __wakeup( )

Prevents unserialization.

Prevents unserialization.

Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\ComponentModel\IComponent
NAME_SEPARATOR
Magic properties summary
public read-only string $name
public read-only Nette\ComponentModel\IContainer|null $parent
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0