public function browser()
    {
        //Gets the type from the query and the supported types from configuration
        $type = $this->request->getQuery('type');
        $types = $this->KcFinder->getTypes();

        //If there's only one type, it automatically sets the query value
        if (!$type && count($types) < 2) {
            $type = array_key_first($types);
            $this->request = $this->request->withQueryParams(compact('type'));
        }

        //Checks the type, then sets the KCFinder path
        if ($type && array_key_exists($type, $types)) {
            //Sets locale
            $locale = substr(I18n::getLocale(), 0, 2);
            $locale = empty($locale) ? 'en' : $locale;

            $this->set('kcfinder', sprintf('%s/kcfinder/browse.php?lang=%s&type=%s', Router::url('/vendor', true), $locale, $type));
        }

        $this->set('types', array_combine(array_keys($types), array_keys($types)));
    }
public function browser()
    {
        //Gets the type from the query and the supported types from configuration
        $type = $this->request->getQuery('type');
        $types = $this->KcFinder->getTypes();

        //If there's only one type, it automatically sets the query value
        if (!$type && count($types) < 2) {
            $type = array_key_first($types);
            $this->request = $this->request->withQueryParams(compact('type'));
        }

        //Checks the type, then sets the KCFinder path
        if ($type && array_key_exists($type, $types)) {
            //Sets locale
            $locale = substr(I18n::getLocale(), 0, 2);
            $locale = empty($locale) ? 'en' : $locale;

            $this->set('kcfinder', sprintf('%s/kcfinder/browse.php?lang=%s&type=%s', Router::url('/vendor', true), $locale, $type));
        }

        $this->set('types', array_combine(array_keys($types), array_keys($types)));
    }
public function browser ( ) { //Gets the type from the query and the supported types from configuration $ type = $ this -> request -> getQuery ( 'type' ) ; $ types = $ this -> KcFinder -> getTypes ( ) ; //If there's only one type, it automatically sets the query value if ( ! $ type && count ( $ types ) < 2 ) { $ type = array_key_first ( $ types ) ; $ this -> request = $ this -> request -> withQueryParams ( compact ( 'type' ) ) ; } //Checks the type, then sets the KCFinder path if ( $ type && array_key_exists ( $ type , $ types ) ) { //Sets locale $ locale = substr ( I18n :: getLocale ( ) , 0 , 2 ) ; $ locale = empty ( $ locale ) ? 'en' : $ locale ; $ this -> set ( 'kcfinder' , sprintf ( '%s/kcfinder/browse.php?lang=%s&type=%s' , Router :: url ( '/vendor' , true ) , $ locale , $ type ) ) ; } $ this -> set ( 'types' , array_combine ( array_keys ( $ types ) , array_keys ( $ types ) ) ) ; }
Media browser with KCFinder.

The KCFinder component is loaded by the `initialize()` method.
@return void
@uses MeCms\Controller\Component\KcFinderComponent::getTypes()
Media browser with KCFinder .