public function categoryOption ($categories , $value = null)
    {
        $options = "";
        if ($categories) {
            foreach ($categories as $category) {
                $line = $this->makeLineForDepth($this->getDepth($category->parent));
                $selected = $value == $category->id ? 'selected' : '';
                $options .= "<option $selected value='{$category->id}'>$line {$category->title}</option>";
                $options .= $this->categoryOption($category->child());
            }
        }
        return $options;
    }