Class Object
Nette\Object is the ultimate ancestor of all instantiable classes.
It defines some handful methods and enhances object core of PHP: - access to undeclared members throws exceptions - support for conventional properties with getters and setters - support for event raising functionality - ability to add new methods to class (extension methods)
Properties is a syntactic sugar which allows access public getter and setter methods as normal object variables. A property is defined by a getter method or setter method (no setter method means read-only property).
$val = $obj->label; // equivalent to $val = $obj->getLabel(); $obj->label = 'Nette'; // equivalent to $obj->setLabel('Nette');
Property names are case-sensitive, and they are written in the camelCaps or PascalCaps.
Event functionality is provided by declaration of property named 'on{Something}' Multiple handlers are allowed.
public $onClick; // declaration in class $this->onClick[] = 'callback'; // attaching event handler if (!empty($this->onClick)) ... // are there any handlers? $this->onClick($sender, $arg); // raises the event with arguments
Adding method to class (i.e. to all instances) works similar to JavaScript prototype property. The syntax for adding a new method is:
MyClass::extensionMethod('newMethod', function(MyClass $obj, $arg, ...) { ... }); $obj = new MyClass; $obj->newMethod($x);
Direct known subclasses
Nette\Application\Application, Nette\Application\Diagnostics\RoutingPanel, Nette\Application\Routers\SimpleRouter, Nette\ArrayList, Nette\Caching\Cache, Nette\Caching\OutputHelper, Nette\Caching\Storages\DevNullStorage, Nette\Caching\Storages\FileJournal, Nette\Caching\Storages\FileStorage, Nette\Caching\Storages\MemcachedStorage, Nette\Caching\Storages\MemoryStorage, Nette\Callback, Nette\Application\PresenterFactory, Nette\ComponentModel\Component, Nette\Config\Adapters\IniAdapter, Nette\Config\Adapters\NeonAdapter, Nette\Config\Adapters\PhpAdapter, Nette\Config\Compiler, Nette\Config\CompilerExtension, Nette\Config\Configurator, Nette\Config\Loader, Nette\Database\Diagnostics\ConnectionPanel, Nette\Database\Drivers\MsSqlDriver, Nette\Application\Responses\FileResponse, Nette\Database\Drivers\MySqlDriver, Nette\Database\Drivers\OciDriver, Nette\Database\Drivers\OdbcDriver, Nette\Database\Drivers\PgSqlDriver, Nette\Database\Drivers\SqliteDriver, Nette\Database\Reflection\ConventionalReflection, Nette\Database\Reflection\DiscoveredReflection, Nette\Database\SqlLiteral, Nette\Database\SqlPreprocessor, Nette\Database\Table\ActiveRow, Nette\Application\Responses\ForwardResponse, Nette\Database\Table\Selection, Nette\Database\Table\SqlBuilder, Nette\DI\ContainerBuilder, Nette\DI\Diagnostics\ContainerPanel, Nette\DI\ServiceDefinition, Nette\DI\Statement, Nette\Diagnostics\Bar, Nette\Diagnostics\BlueScreen, Nette\Diagnostics\FireLogger, Nette\Diagnostics\Logger, Nette\Application\Responses\JsonResponse, Nette\Forms\ControlGroup, Nette\Forms\Rendering\DefaultFormRenderer, Nette\Forms\Rule, Nette\Forms\Rules, Nette\FreezableObject, Nette\Http\Context, Nette\Http\FileUpload, Nette\Http\Request, Nette\Http\RequestFactory, Nette\Http\Response, Nette\Application\Responses\RedirectResponse, Nette\Http\Session, Nette\Http\SessionSection, Nette\Http\UserStorage, Nette\Image, Nette\Latte\Compiler, Nette\Latte\Engine, Nette\Latte\HtmlNode, Nette\Latte\MacroNode, Nette\Latte\Macros\CacheMacro, Nette\Latte\Macros\MacroSet, Nette\Application\Responses\TextResponse, Nette\Latte\Parser, Nette\Latte\PhpWriter, Nette\Latte\Token, Nette\Loaders\AutoLoader, Nette\Mail\MimePart, Nette\Mail\SendmailMailer, Nette\Mail\SmtpMailer, Nette\Reflection\Annotation, Nette\Security\Diagnostics\UserPanel, Nette\Security\Permission, Nette\Application\Routers\CliRouter, Nette\Security\SimpleAuthenticator, Nette\Security\User, Nette\Templating\Template, Nette\Utils\Finder, Nette\Utils\Html, Nette\Utils\Neon, Nette\Utils\Paginator, Nette\Utils\PhpGenerator\ClassType, Nette\Utils\PhpGenerator\Method, Nette\Utils\PhpGenerator\Parameter, Nette\Application\Routers\Route, Nette\Utils\PhpGenerator\Property, Nette\Utils\Tokenizer, Nette\Utils\Validators, NetteModule\MicroPresenterIndirect known subclasses
Nette\Application\Request, Nette\Application\Routers\RouteList, Nette\Config\Extensions\NetteExtension, Nette\Config\Extensions\PhpExtension, Nette\Database\Drivers\Sqlite2Driver, Nette\Database\Table\GroupedSelection, Nette\DI\Container, Nette\Forms\Container, Nette\Forms\Controls\BaseControl, Nette\Forms\Controls\Button, Nette\Forms\Controls\Checkbox, Nette\Forms\Controls\HiddenField, Nette\Application\UI\Control, Nette\Forms\Controls\ImageButton, 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\Forms\Controls\TextInput, Nette\Forms\Controls\UploadControl, Nette\Forms\Form, Nette\Application\UI\Form, Nette\Http\Url, Nette\Http\UrlScript, Nette\Latte\Macros\CoreMacros, Nette\Latte\Macros\FormMacros, Nette\Latte\Macros\UIMacros, Nette\Latte\MacroTokenizer, Nette\Loaders\NetteLoader, Nette\Loaders\RobotLoader, Nette\Mail\Message, Nette\Security\Identity, Nette\Application\UI\Multiplier, Nette\Templating\FileTemplate, Nette\Application\UI\Presenter, Nette\Application\UI\PresenterComponent, Nette\Caching\Storages\PhpFileStorage, Nette\ComponentModel\Container, Nette\Config\Extensions\ConstantsExtension
public static
|
|
public
mixed
|
|
public static
mixed
|
|
public static
mixed
|
|
public
mixed
&
|
|
public
|
|
public
boolean
|
|
public
|
public read-only
|
$reflection |