Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • BackendBindings
  • InputProvider
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * PHP version 5
  4:  * @package    generalDriver
  5:  * @author     Christian Schiffler <c.schiffler@cyberspectrum.de>
  6:  * @author     Stefan Heimes <stefan_heimes@hotmail.com>
  7:  * @author     Tristan Lins <tristan.lins@bit3.de>
  8:  * @copyright  The MetaModels team.
  9:  * @license    LGPL.
 10:  * @filesource
 11:  */
 12: 
 13: namespace DcGeneral\Contao;
 14: 
 15: use DcGeneral\InputProviderInterface;
 16: 
 17: /**
 18:  * Class InputProvider.
 19:  *
 20:  * This class is the Contao binding of an input provider.
 21:  *
 22:  * @package DcGeneral\Contao
 23:  */
 24: class InputProvider implements InputProviderInterface
 25: {
 26:     /**
 27:      * {@inheritDoc}
 28:      */
 29:     public function getParameter($strKey, $blnRaw = false)
 30:     {
 31:         // TODO: raw handling not implemented yet.
 32:         return \Input::getInstance()->get($strKey);
 33:     }
 34: 
 35:     /**
 36:      * {@inheritDoc}
 37:      */
 38:     public function setParameter($strKey, $varValue)
 39:     {
 40:         \Input::getInstance()->setGet($strKey, $varValue);
 41: 
 42:         return $this;
 43:     }
 44: 
 45:     /**
 46:      * {@inheritDoc}
 47:      */
 48:     public function unsetParameter($strKey)
 49:     {
 50:         \Input::getInstance()->setGet($strKey, null);
 51: 
 52:         return $this;
 53:     }
 54: 
 55:     /**
 56:      * {@inheritDoc}
 57:      */
 58:     public function hasParameter($strKey)
 59:     {
 60:         return (\Input::getInstance()->get($strKey) !== null);
 61:     }
 62: 
 63:     /**
 64:      * {@inheritDoc}
 65:      */
 66:     public function getValue($strKey, $blnRaw = false)
 67:     {
 68:         if ($blnRaw)
 69:         {
 70:             return \Input::getInstance()->postRaw($strKey);
 71:         }
 72: 
 73:         // TODO: unsure if we should use postHtml here.
 74:         return \Input::getInstance()->post($strKey);
 75:     }
 76: 
 77:     /**
 78:      * {@inheritDoc}
 79:      */
 80:     public function setValue($strKey, $varValue)
 81:     {
 82:         \Input::getInstance()->setPost($strKey, $varValue);
 83: 
 84:         return $this;
 85:     }
 86: 
 87:     /**
 88:      * {@inheritDoc}
 89:      */
 90:     public function unsetValue($strKey)
 91:     {
 92:         \Input::getInstance()->setPost($strKey, null);
 93: 
 94:         return $this;
 95:     }
 96: 
 97:     /**
 98:      * {@inheritDoc}
 99:      */
100:     public function hasValue($strKey)
101:     {
102:         return (\Input::getInstance()->post($strKey) !== null);
103:     }
104: 
105:     /**
106:      * {@inheritDoc}
107:      */
108:     public function getPersistentValue($strKey)
109:     {
110:         return \Session::getInstance()->get($strKey);
111:     }
112: 
113:     /**
114:      * {@inheritDoc}
115:      */
116:     public function setPersistentValue($strKey, $varValue)
117:     {
118:         \Session::getInstance()->set($strKey, $varValue);
119: 
120:         return $this;
121:     }
122: 
123:     /**
124:      * {@inheritDoc}
125:      */
126:     public function hasPersistentValue($strKey)
127:     {
128:         return (\Session::getInstance()->get($strKey) !== null);
129:     }
130: 
131:     /**
132:      * {@inheritDoc}
133:      */
134:     public function getRequestUrl()
135:     {
136: 
137:         return \Environment::getInstance()->request;
138:     }
139: }
140: 
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0