Get a stub file by name.

@param string $name
@param string $type
@return string
193450
protected function getStub($name, $type)
    {
        if (stripos($name, '.php') === false) {
            $name = $name . '.php';
        }

        return $this->filesystem->get($this->getStubsPath($type) . '/' . $name);
    }
4203
public function getFile(string $name)
    {
        return $this->fileContentAreas->where(function (FileContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        })->first();
    }
704808
public static function input($name, $type = INPUT_SERVER)
    {
        //====================================================================//
        // Standard Safe Reading
        $result = filter_input($type, $name);
        if (null !== $result) {
            return $result;
        }
        //====================================================================//
        // Fallback Reading
        if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        if ((INPUT_GET === $type) && isset($_GET[$name])) {
            return $_GET[$name];
        }

        return null;
    }
325979
protected function loadFont($name, $type)
    {
        if (file_exists($name)) {
            return $name;
        }

        $path = sprintf('%s/%s/%s', $this->resourcePath, $type, $name);
        if (file_exists($path)) {
            return $path;
        }

        throw new Exception(
            sprintf('The requested resource %s (%s) has not been found!', $name, $type)
        );
    }
135598
public function getByBasename($name)
    {
        return $this->where(function(File $f) use($name) { return $f->getBasename()==$name; })->single();
    }
380180
public function get($category, $type, $name)
    {
        /* Get the path to the folder with the images. */
        $directory = \Yii::getAlias($this->owner->imagesPath);
        $imagePath = implode(DIRECTORY_SEPARATOR, [$directory, $category]);
        $images = glob($imagePath . DIRECTORY_SEPARATOR . "$name-$type.*");
        if (empty($images)) {
            return false;
        }
        /* Get the first matched file. */
        $image = $images[0];
        return FileHelper::normalizePath($image);
    }
900388
public function getArg(string $name, string $type = null, $default = null)
    {
        if ($this->method == 'POST') {
            return $this->getPost($name, $type, $default);
        } else {
            return $this->getQuery($name, $type, $default);
        }
    }
2869
public static function get($type, $name)
    {

        return ModuleCompiler::get($type, $name) ?: static::where('type', $type)->where('name', $name)->first();
    }
178438
public static function files(String $fileName = NULL, String $type = 'name')
    {
        return $_FILES[$fileName][$type] ?? false;
    }
986085
private function createTypeMessage(string $type, string $name = null): string
    {
        return ((null !== $name) ? ($type . ' (named "' . $name . '")') : ($type));
    }
1233599
private static function createValidator($name, $type)
    {
        return \call_user_func_array([Validator::create(), ValidatorType::getMethod($type)], [$name]);
    }
172081
public function file(string $name): string {
        if (!isset($this->file[$name])) {
            return "";
        }
        return $this->file[$name];
    }
279226
function _get_plugin_filepath($type, $name)
	{
		$_params = array('type' => $type, 'name' => $name);
		require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
		return smarty_core_assemble_plugin_filepath($_params, $this);
	}
269725
static public function getByType($type, $name = null, $inherit=false)
    {
        // first get [logs.xxx], then [xxx.log]
        if (!($value = static::get($type . 's.' . $name))) {
            if (!($value = static::get($name . '.' . $type))) {
                $value = static::get($type, $name, $inherit);
            }
        }
        
        return $value;
    }
10253
protected static function _params($type, $name = "*") {
		if (!$name) {
			$name = '*';
		}
		$library = $namespace = $class = '*';

		if (strpos($type, '.') !== false) {
			$parts = explode('.', $type);
			$type = array_shift($parts);

			switch (count($parts)) {
				case 1:
					list($class) = $parts;
				break;
				case 2:
					list($namespace, $class) = $parts;
				break;
				default:
					$class = array_pop($parts);
					$namespace = join('\\', $parts);
				break;
			}
		}
		if (strpos($name, '.') !== false) {
			$parts = explode('.', $name);
			$library = array_shift($parts);
			$name = array_pop($parts);
			$namespace = $parts ? join('\\', $parts) : "*";
		}
		return compact('library', 'namespace', 'type', 'class', 'name');
	}
1012016
public function searchByNameAndType($name = null, $type = null)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('models/searches'),
            [
                'model_query' => [
                    'name' => $name,
                    'type' => $type,
                ],

            ]
        );

        return $this->getModelsFromResult($searchResult);
    }
823734
public function getFiles($type)
	{
		$f = $type . 'Files';

		if (property_exists($this, $f))
		{
			return self::${$f};
		}

		$this->say('Missing Files: ' . $type);

		return "";
	}