WPDKHTML::startCompress PHP Method

startCompress() public static method

Utility to start buffering
public static startCompress ( )
    public static function startCompress()
    {
        ob_start();
    }

Usage Example

コード例 #1
0
ファイル: wpdk-ui.php プロジェクト: wpxtreme/wpdk
    /**
     * Return HTML markup for a input type
     *
     * @brief Simple button
     *
     * @param string $label Optional. Button label. If empty default is 'Update'
     * @param array  $args  Optional. A keys value array for additional settings
     *
     *     'type'                  => 'submit',
     *     'name'                  => 'button-update',
     *     'classes'               => ' button-primary',
     *     'additional_classes'    => '',
     *     'data'                  => ''
     *
     * @return string HTML input type submit
     */
    public static function button($label = '', $args = array())
    {
        $default_args = array('type' => 'submit', 'name' => 'button-update', 'classes' => ' button button-primary alignright', 'additional_classes' => '', 'data' => array());
        $args = wp_parse_args($args, $default_args);
        // Label
        if (empty($label)) {
            $label = __('Update', WPDK_TEXTDOMAIN);
        }
        // Name attribute
        if (empty($args['name'])) {
            $name = '';
        } else {
            $name = sprintf('name="%s"', $args['name']);
        }
        // Build data
        $data = WPDKHTMLTag::dataInline($args['data']);
        // Build classes
        $classes = WPDKHTMLTag::classInline($args['classes'], $args['additional_classes']);
        WPDKHTML::startCompress();
        ?>

    <input type="<?php 
        echo $args['type'];
        ?>
" <?php 
        echo $name;
        ?>
      <?php 
        echo $data;
        ?>
           class="<?php 
        echo $classes;
        ?>
"
           value="<?php 
        echo $label;
        ?>
" />

    <?php 
        return WPDKHTML::endHTMLCompress();
    }
All Usage Examples Of WPDKHTML::startCompress