modules/tag/models/Tag.php
public static function listTags($tagType = null, $limit = 30)
    {
        $model = self::find()
            ->select('name')
            ->orderBy('frequency DESC, Name')
            ->limit($limit);
            if (!is_null($tagType)) {
                $data = $model->where('tag_type = :type', [':type' => $tagType])->all();
            } else {
                $data = $model->all();
            }

        $return = [''];
        if (!empty($data)) {
            foreach ($data as $tag) {
                $return[] = $tag->name;
            }
        }
        return $return;
    }
public static function listTags($tagType = null, $limit = 30)
    {
        $model = self::find()
            ->select('name')
            ->orderBy('frequency DESC, Name')
            ->limit($limit);
            if (!is_null($tagType)) {
                $data = $model->where('tag_type = :type', [':type' => $tagType])->all();
            } else {
                $data = $model->all();
            }

        $return = [''];
        if (!empty($data)) {
            foreach ($data as $tag) {
                $return[] = $tag->name;
            }
        }
        return $return;
    }
Returns array of tags by tag type
@param null $tagType
@param int $limit
@return array