app/maguttiCms/Admin/AdminFormSelect.php
/**
     * This method is used to render the form element.
     *
     * @return string
     */
This method is used to render the form element.
@return string
This method is used to render the form element . @return string
public function render(): string
    {
        $openingTag = "<select name=\"{$this->name}\" class=\"form-select\">";
        $closingTag = "</select>";
        $formElement = $openingTag;
        foreach ($this->options as $key => $value) {
            $formElement .= "<option value=\"$key\"";
            if ($key == $this->selected) {
                $formElement .= " selected";
            }
            $formElement .= ">$value</option>";
        }
        $formElement .= $closingTag;
        return $formElement;
    }
public function render ( ) : string { $ openingTag = " <select name= \" { $ this -> name } \"  class= \" form-select \" > " ; $ closingTag = " </select> " ; $ formElement = $ openingTag ; foreach ( $ this -> options as $ key => $ value ) { $ formElement .= " <option value= \" $ key \" " ; if ( $ key == $ this -> selected ) { $ formElement .= "  selected " ; } $ formElement .= " > $ value </option> " ; } $ formElement .= $ closingTag ; return $ formElement ; }
This method is used to render the form element.
This method is used to render the form element .
// Start building the form element. // Append the opening option tag. // Mark it as selected if necessary. // Append the closing option tag.