addPrefixPath example



    /** * Add prefix path for all elements * * @param string $prefix * @param string $path * @return Zend_Filter_Input */
    public function addFilterPrefixPath($prefix$path)
    {
        $this->getPluginLoader(self::FILTER)->addPrefixPath($prefix$path);

        return $this;
    }

    /** * Add prefix path for all elements * * @param string $prefix * @param string $path * @return Zend_Filter_Input */
    


    /** * Setter method for the plugin property. * * @return Enlight_Controller_Front */
    public function setPlugins(?Enlight_Plugin_Namespace $plugins = null)
    {
        if ($plugins === null) {
            $plugins = new Enlight_Plugin_Namespace_Loader('Controller');
            $plugins->addPrefixPath('Enlight_Controller_Plugins', __DIR__ . DIRECTORY_SEPARATOR . 'Plugins');
        }
        $this->plugins = $plugins;

        return $this;
    }

    /** * Setter method for the router. Sets the front controller instance * automatically in the given router. * * @param class-string<Enlight_Controller_Router>|Enlight_Controller_Router $router * * @throws Enlight_Exception * * @return Enlight_Controller_Front */


    /** * Convienence method to add prefix and path to PluginLoader * * @param string $prefix * @param string $path * @return Zend_Filter_Inflector */
    public function addFilterPrefixPath($prefix$path)
    {
        $this->getPluginLoader()->addPrefixPath($prefix$path);
        return $this;
    }

    /** * Set Whether or not the inflector should throw an exception when a replacement * identifier is still found within an inflected target. * * @param bool $throwTargetExceptions * @return Zend_Filter_Inflector */
    public function setThrowTargetExceptionsOn($throwTargetExceptionsOn)
    {
if (!class_exists($device)) {
                    throw new Zend_Http_UserAgent_Exception(sprintf(
                        'Invalid classname "%s" provided in device configuration for browser type "%s"',
                        $device,
                        $browserType
                    ));
                }
            } elseif (is_array($deviceConfig) && isset($deviceConfig['path'])) {
                $loader = $this->getPluginLoader('device');
                $path   = $deviceConfig['path'];
                $prefix = isset($deviceConfig['prefix']) ? $deviceConfig['prefix'] : 'Zend_Http_UserAgent';
                $loader->addPrefixPath($prefix$path);

                $device = $loader->load($browserType);
            } else {
                $loader = $this->getPluginLoader('device');
                $device = $loader->load($browserType);
            }
        } else {
            $loader = $this->getPluginLoader('device');
            $device = $loader->load($browserType);
        }

        
if (is_string($staticRegistryName) && !empty($staticRegistryName)) {
            $this->_useStaticRegistry = $staticRegistryName;
            if(!isset(self::$_staticPrefixToPaths[$staticRegistryName])) {
                self::$_staticPrefixToPaths[$staticRegistryName] = array();
            }
            if(!isset(self::$_staticLoadedPlugins[$staticRegistryName])) {
                self::$_staticLoadedPlugins[$staticRegistryName] = array();
            }
        }

        foreach ($prefixToPaths as $prefix => $path) {
            $this->addPrefixPath($prefix$path);
        }
    }

    /** * Format prefix for internal use * * @param string $prefix * @return string */
    protected function _formatPrefix($prefix)
    {
        
Home | Imprint | This part of the site doesn't use cookies.