Gets the in use view-mode information.

You can get either, slug only or full information as an array.

@param bool $full Set to true to get full information as an array,
or set to false (by default) to get slug name only
@return array|string
480770
public static function current($full = false)
    {
        if (empty(static::$_current)) {
            return '';
        } elseif ($full === false) {
            return static::$_current;
        }

        return static::$_modes[static::$_current];
    }
1323860
protected function checkIfReservedWordInUrl($url = false)
    {
        $sections = $this->getCurrentUrlSections();
        if (count($sections) >= 1) {
            $last = intval($sections[count($sections) - 1]);
        }

        $keywords = [
            'show',
            'create',
            'edit',
        ];

        foreach ($sections as $key => $slug) {
            if (in_array($slug, $keywords)) {
                return $slug;
            }
        }

        // resource ID
        if ($last >= 1) {
            return 'show';
        }

        return false;
    }
888618
protected function getFileHandle($fullPath, $mode)
    {
        $key = md5($fullPath.$mode);
        if (array_key_exists($key, $this->openFileHandles)) {
            $handle = $this->openFileHandles[$key];
        } else {
            $handle = fopen($fullPath, $mode);
            $this->openFileHandles[$key] = $handle;
        }

        if ('stream' !== get_resource_type($handle)) {
            throw new \Exception('The file handle is not a file stream!');
        }

        if (false !== strpos($mode, 'w')) {
            if ('stream' === !is_writeable($fullPath)) {
                throw new \Exception('The file handle in the context is not writeable!');
            }
        }

        return $handle;
    }
818894
public function actionIndex()
    {
        $variables = [];
        $this->baseVariables($variables);

        $variables['fullPageForm'] = true;

        return $this->renderTemplate(static::TEMPLATE_INDEX, $variables);
    }
1248827
public function getFullRoutes()
	{
		// if has saved already, return that.
		if($this->fullRoutes !== null)
			return $this->fullRoutes;

		$routes = array();

		$routes[] = $this;
		
		$group = $this->group;

        /** @var Route $route */
		while($route = $group->getUpperRoute())
		{
			$routes[] = $route;

			// recursively refer to upperRoute's group
			$group = $route->getGroup();
		}

		$this->fullRoutes = array_reverse($routes);

		return $this->fullRoutes;
	}
1185107
public function GetCurrentViewFullPath () {
		$result = NULL;
		$renderedFullPaths = & $this->__protected['renderedFullPaths'];
		$count = count($renderedFullPaths);
		if ($count > 0)
			$result = $renderedFullPaths[$count - 1];
		return $result;
	}
92547
public function method($full = false) {
		$message  = '`\lithium\util\collection\Filters::method()` has been deprecated ';
		$message .= 'in favor of `\lithium\aop\Chain::method()`';
		trigger_error($message, E_USER_DEPRECATED);

		return $full ? $this->_class . '::' . $this->_method : $this->_method;
	}
360375
public function getFullName(): ?string
    {
        if (null === $this->getName()) {
            return null;
        }

        if (!($this instanceof ElementHasParentInterface)) {
            return $this->getName();
        }

        $parents = $this->getParents();

        if ($parents->empty()) {
            return $this->getName();
        }

        $chain = $parents->append($this);
        $sliced = new Collection();
        foreach ($chain->reverse() as $el) {
            if (null === $el->getName()) {
                break;
            }
            $sliced->prepend($el);
        }
        if (1 === count($sliced)) {
            return $this->getName();
        }

        $names = [];
        $first = $sliced->first();
        foreach ($sliced as $el) {
            if ($el === $first) {
                $names[] = $el->getName();
            } else {
                $names[] = $el->getParent()->searchSame($el);
            }
        }

        return $names[0] . '[' . implode('][', array_slice($names, 1)) . ']';

    }
973613
public function getEntry($full = true)
    {
        $key = $full ? 'scriptFilename' : 'scriptName';

        $wDir = $this->get('workDir');
        $file = $this->get($key);

        if (strpos($file, $wDir) === 0) {
            $file = substr($file, \strlen($wDir));
        }

        $file = rtrim($file, '.' . DIRECTORY_SEPARATOR);

        if ($full && $this->get('isCli')) {
            $file = $wDir . DIRECTORY_SEPARATOR . $file;
        }

        return $file;
    }
615990
public function url($url = null, $full = false) {
		if (CakePlugin::loaded('I18n')) {
			$url = Common::url($url);
			if (is_array($url) && !array_key_exists('lang', $url)) {
				$url['lang'] = Configure::read('Config.language');
			}
		}

		return parent::url($url, $full);
	}
1160458
public function fullUrl()
    {
        $query = $this->getQueryString();

        return $query ? $this->url().'?'.$query : $this->url();
    }
896802
public function getFullName()
    {
        $first = isset($this->response["firstName"]) ? $this->response["firstName"] : "";
        $last = isset($this->response["lastName"]) ? $this->response["lastName"] : "";

        return trim($first . " " . $last);
    }
565608
public function getEntities($full = false)
    {
        return
            $full ?
                $this->getManifest()->transform(function ($item) {
                    return $this->getEntity($item[ 'full_name' ]);
                })
                :
                $this->getManifest();
    }
72991
public function getMessages($fullnames = false) {

		if(false === is_bool($fullnames)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($fullnames)), E_USER_ERROR);
		}

		$instance = $this -> getMessageInstance();
		return $instance :: getErrors($fullnames);
	}
914273
public function fullUrlIs()
    {
        $url = $this->fullUrl();

        foreach (func_get_args() as $pattern) {
            if (Str::is($pattern, $url)) {
                return true;
            }
        }

        return false;
    }
1100091
public function getSupportedLanguages($full_names = false)
    {
        // return array
        $back = [];

        // we walk the lang root
        $dir = dir(self::LANG_ROOT);

        // foreach entry
        while (false !== ($entry = $dir->read())) {
            $full_path = self::LANG_ROOT . $entry;

            // Skip all dirs
            if (is_dir($full_path)) {
                continue;
            }

            // we only want lang.php files
            if (!preg_match('/^([^.]+)\.php$/', $entry, $matches)) {
                continue;
            }

            // Raw lang name is here
            $langname = $matches[1];

            // We want the fullname too?
            if ($full_names === true) {
                if (false !== ($fullname = $this->getLanguageFullname($langname))) {
                    $back[$langname] = $fullname; // we go associative
                }
            }
            else {
                // just store raw langname
                $back[] = $langname;
            }
        }

        $dir->close();

        return $back;
    }
751684
public function url($source, $full = true)
    {
        $stamp = Configure::read('Asset.timestamp');
        $url = parent::url($source, $full);

        if ($url !== null && $stamp && strpos($url, '?') === false) {
            $fullPath = $this->get($source);
            $url .= '?' . @filemtime($fullPath);
        }

        return $url;
    }