Source for file PresenterComponent.php
Documentation is available at PresenterComponent.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see http://nettephp.com
- 12: *
- 18: */
- 30: /**
- 31: * PresenterComponent is the base class for all presenters components.
- 32: *
- 33: * Components are persistent objects located on a presenter. They have ability to own
- 34: * other child components, and interact with user. Components have properties
- 35: * for storing their status, and responds to user command.
- 36: *
- 40: *
- 42: */
- 43: abstract class PresenterComponent extends ComponentContainer implements ISignalReceiver, IStatePersistent, ArrayAccess
- 44: {
- 50: /**
- 51: */
- 53: {
- 56: }
- 60: /**
- 61: * Returns the presenter where this component belongs to.
- 64: */
- 66: {
- 68: }
- 72: /**
- 73: * Returns a fully-qualified name that uniquely identifies the component
- 74: * within the presenter hierarchy.
- 76: */
- 78: {
- 80: }
- 84: /**
- 85: * This method will be called when the component (or component's parent)
- 86: * becomes attached to a monitored object. Do not call this method yourself.
- 89: */
- 91: {
- 94: }
- 95: }
- 99: /**
- 100: * Calls public method if exists.
- 104: */
- 106: {
- 112: }
- 114: }
- 118: /********************* interface IStatePersistent ****************d*g**/
- 122: /**
- 123: * Loads state informations.
- 126: */
- 128: {
- 130: {
- 134: }
- 136: }
- 137: }
- 139: }
- 143: /**
- 144: * Saves state informations for next request.
- 148: */
- 150: {
- 151: foreach (PresenterHelpers::getPersistentParams($forClass === NULL ? $this->getClass() : $forClass) as $nm => $meta)
- 152: {
- 164: }
- 167: throw new InvalidStateException("Persistent parameter must be scalar or array, '$this->class::\$$nm' is " . gettype($val));
- 175: }
- 177: }
- 178: }
- 179: }
- 183: /**
- 184: * Returns component param.
- 185: * If no key is passed, returns the entire array.
- 189: */
- 191: {
- 200: }
- 201: }
- 205: /**
- 206: * Returns a fully-qualified name that uniquely identifies the parameter.
- 208: */
- 210: {
- 213: }
- 217: /**
- 218: * Returns array of classes persistent parameters. They have public visibility and are non-static.
- 219: * This default implementation detects persistent parameters by annotation @persistent.
- 221: */
- 223: {
- 229: }
- 230: }
- 232: }
- 236: /********************* interface ISignalReceiver ****************d*g**/
- 240: /**
- 241: * Calls signal handler method.
- 245: */
- 247: {
- 249: throw new BadSignalException("There is no handler for signal '$signal' in '{$this->getClass()}' class.");
- 250: }
- 251: }
- 255: /**
- 256: * Formats signal handler method name -> case sensitivity doesn't matter.
- 259: */
- 261: {
- 263: }
- 267: /********************* navigation ****************d*g**/
- 271: /**
- 272: * Generates URL to presenter, action or signal.
- 277: */
- 279: {
- 283: }
- 290: }
- 291: }
- 295: /**
- 296: * Returns destination as Link object.
- 300: */
- 302: {
- 306: }
- 309: }
- 313: /**
- 315: */
- 317: {
- 319: }
- 323: /**
- 324: * Redirect to another presenter, action or signal.
- 330: */
- 332: {
- 337: }
- 342: }
- 345: $presenter->redirectUri($presenter->createRequest($this, $destination, $args, 'redirect'), $code);
- 346: }
- 350: /********************* interface \ArrayAccess ****************d*g**/
- 354: /**
- 355: * Adds the component to the container.
- 359: */
- 361: {
- 363: }
- 367: /**
- 368: * Returns component specified by name. Throws exception if component doesn't exist.
- 372: */
- 374: {
- 376: }
- 380: /**
- 381: * Does component specified by name exists?
- 384: */
- 386: {
- 388: }
- 392: /**
- 393: * Removes component from the container. Throws exception if component doesn't exist.
- 396: */
- 398: {
- 402: }
- 403: }
- 405: }