Changeset 1498

Show
Ignore:
Timestamp:
12/12/07 12:32:17 (9 months ago)
Author:
Shadowhand
Message:

Added toString to Forge.

Location:
trunk/modules/forge/libraries
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/forge/libraries/Forge.php

    r1461 r1498  
    1515    protected $hidden = array(); 
    1616 
    17     public function __construct($action = '', $title = '', $method = 'post') 
     17    public function __construct($action = '', $title = '', $method = NULL, $class = NULL) 
    1818    { 
     19        empty($method) and $method = 'post'; 
     20        empty($class)  and $class  = 'form'; 
     21 
    1922        // Set action 
    2023        $this->template['action'] = $action; 
     
    104107    } 
    105108 
     109    /** 
     110     * Creates the form HTML 
     111     * 
     112     * @param   string   form view template name 
     113     * @return  string 
     114     */ 
    106115    public function html($template = 'forge_template') 
    107116    { 
     
    128137    } 
    129138 
     139    /** 
     140     * Returns the form HTML 
     141     */ 
     142    public function __toString() 
     143    { 
     144        return $this->html(); 
     145    } 
     146 
    130147} // End Forge 
  • trunk/modules/forge/libraries/Form_Dropdown.php

    r1439 r1498  
    11<?php defined('SYSPATH') or die('No direct script access.'); 
    22 
    3 class Form_Dropdown_Core extends Form_input{ 
     3class Form_Dropdown_Core extends Form_Input { 
    44 
    55    protected $data = array 
     
    3030        $selected = arr::remove('selected', $base_data); 
    3131 
    32         // Add an empty option to the beginning of the options 
    33         arr::unshift_assoc($options, '', '--'); 
    34  
    3532        return form::dropdown($base_data, $options, $selected); 
    3633    }