Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

  • Context
  • FileUpload
  • Request
  • RequestFactory
  • Response
  • Session
  • SessionSection
  • Url
  • UrlScript
  • UserStorage

Interfaces

  • IRequest
  • IResponse
  • ISessionStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  *
 6:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * For the full copyright and license information, please view
 9:  * the file license.txt that was distributed with this source code.
10:  */
11: 
12: namespace Nette\Http;
13: 
14: use Nette;
15: 
16: 
17: 
18: /**
19:  * Extended HTTP URL.
20:  *
21:  * <pre>
22:  * http://nette.org/admin/script.php/pathinfo/?name=param#fragment
23:  *                 \_______________/\________/
24:  *                        |              |
25:  *                   scriptPath       pathInfo
26:  * </pre>
27:  *
28:  * - scriptPath:  /admin/script.php (or simply /admin/ when script is directory index)
29:  * - pathInfo:    /pathinfo/ (additional path information)
30:  *
31:  * @author     David Grudl
32:  *
33:  * @property   string $scriptPath
34:  * @property-read string $pathInfo
35:  */
36: class UrlScript extends Url
37: {
38:     /** @var string */
39:     private $scriptPath = '/';
40: 
41: 
42: 
43:     /**
44:      * Sets the script-path part of URI.
45:      * @param  string
46:      * @return UrlScript  provides a fluent interface
47:      */
48:     public function setScriptPath($value)
49:     {
50:         $this->updating();
51:         $this->scriptPath = (string) $value;
52:         return $this;
53:     }
54: 
55: 
56: 
57:     /**
58:      * Returns the script-path part of URI.
59:      * @return string
60:      */
61:     public function getScriptPath()
62:     {
63:         return $this->scriptPath;
64:     }
65: 
66: 
67: 
68:     /**
69:      * Returns the base-path.
70:      * @return string
71:      */
72:     public function getBasePath()
73:     {
74:         $pos = strrpos($this->scriptPath, '/');
75:         return $pos === FALSE ? '' : substr($this->path, 0, $pos + 1);
76:     }
77: 
78: 
79: 
80:     /**
81:      * Returns the additional path information.
82:      * @return string
83:      */
84:     public function getPathInfo()
85:     {
86:         return (string) substr($this->path, strlen($this->scriptPath));
87:     }
88: 
89: }
90: 
Nette Framework 2.0.7 API API documentation generated by ApiGen 2.8.0