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 https://nette.org
- 12: *
- 19: */
- 31: /**
- 32: * PresenterComponent is the base class for all presenters components.
- 33: *
- 34: * Components are persistent objects located on a presenter. They have ability to own
- 35: * other child components, and interact with user. Components have properties
- 36: * for storing their status, and responds to user command.
- 37: *
- 41: */
- 42: abstract class PresenterComponent extends ComponentContainer implements ISignalReceiver, IStatePersistent
- 43: {
- 49: /**
- 50: */
- 52: {
- 55: }
- 59: /**
- 60: * Returns the presenter where this component belongs to.
- 63: */
- 65: {
- 67: }
- 71: /**
- 72: * Returns a fully-qualified name that uniquely identifies the component
- 73: * within the presenter hierarchy.
- 75: */
- 77: {
- 79: }
- 83: /**
- 84: * This method will be called when the component (or component's parent)
- 85: * becomes attached to a monitored object. Do not call this method yourself.
- 88: */
- 90: {
- 93: }
- 94: }
- 98: /**
- 99: * Calls public method if exists.
- 103: */
- 105: {
- 111: }
- 113: }
- 117: /********************* interface IStatePersistent ****************d*g**/
- 121: /**
- 122: * Loads state informations.
- 125: */
- 127: {
- 129: {
- 133: }
- 135: }
- 136: }
- 138: }
- 142: /**
- 143: * Saves state informations for next request.
- 147: */
- 149: {
- 150: foreach (PresenterHelpers::getPersistentParams($forClass === NULL ? $this->getClass() : $forClass) as $nm => $meta)
- 151: {
- 163: }
- 166: throw new InvalidStateException("Persistent parameter must be scalar or array, '$this->class::\$$nm' is " . gettype($val));
- 174: }
- 176: }
- 177: }
- 178: }
- 182: /**
- 183: * Returns component param.
- 184: * If no key is passed, returns the entire array.
- 188: */
- 190: {
- 199: }
- 200: }
- 204: /**
- 205: * Returns a fully-qualified name that uniquely identifies the parameter.
- 207: */
- 209: {
- 212: }
- 216: /**
- 217: * Returns array of classes persistent parameters. They have public visibility and are non-static.
- 218: * This default implementation detects persistent parameters by annotation @persistent.
- 220: */
- 222: {
- 228: }
- 229: }
- 231: }
- 235: /********************* interface ISignalReceiver ****************d*g**/
- 239: /**
- 240: * Calls signal handler method.
- 244: */
- 246: {
- 248: throw new BadSignalException("There is no handler for signal '$signal' in '{$this->getClass()}' class.");
- 249: }
- 250: }
- 254: /**
- 255: * Formats signal handler method name -> case sensitivity doesn't matter.
- 258: */
- 260: {
- 262: }
- 266: /********************* navigation ****************d*g**/
- 270: /**
- 271: * Generates URL to presenter, action or signal.
- 276: */
- 278: {
- 282: }
- 289: }
- 290: }
- 295: {
- 299: }
- 302: }
- 307: {
- 308: return $this->getPresenter()->getAjaxDriver()->link($destination === NULL ? NULL : $this->link($destination, $args));
- 309: }
- 313: /**
- 314: * Redirect to another presenter, action or signal.
- 320: */
- 322: {
- 327: }
- 332: }
- 335: $presenter->redirectUri($presenter->createRequest($this, $destination, $args, 'redirect'), $code);
- 336: }
- 338: }