Source for file PresenterLoader.php
Documentation is available at PresenterLoader.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: */
- 26: /**
- 27: * Default presenter loader.
- 28: *
- 32: */
- 34: {
- 46: /**
- 48: */
- 50: {
- 52: }
- 56: /**
- 60: */
- 62: {
- 66: }
- 69: throw new InvalidPresenterException("Presenter name must be alphanumeric string, '$name' is invalid.");
- 70: }
- 75: // internal autoloading
- 79: }
- 82: throw new InvalidPresenterException("Cannot load presenter '$name', class '$class' was not found in '$file'.");
- 83: }
- 84: }
- 90: throw new InvalidPresenterException("Cannot load presenter '$name', class '$class' is not Nette\\Application\\IPresenter implementor.");
- 91: }
- 94: throw new InvalidPresenterException("Cannot load presenter '$name', class '$class' is abstract.");
- 95: }
- 97: // canonicalize presenter name
- 101: throw new InvalidPresenterException("Cannot load presenter '$name', case mismatch. Real name is '$realName'.");
- 105: }
- 108: }
- 111: }
- 115: /**
- 116: * Formats presenter class name from its name.
- 119: */
- 121: {
- 122: // PHP 5.3
- 125: }
- 129: /**
- 130: * Formats presenter name from class name.
- 133: */
- 135: {
- 136: // PHP 5.3
- 139: }
- 143: /**
- 144: * Formats presenter class file name.
- 147: */
- 149: {
- 151: return $this->baseDir . substr_replace($path, '/presenters', strrpos($path, '/'), 0) . 'Presenter.php';
- 152: }
- 154: }