PHP code example of wpbones / pure-css-tabs

1. Go to this page and download the library: Download wpbones/pure-css-tabs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wpbones / pure-css-tabs example snippets

 copy
public function index()
{
  // enqueue the minified version
  PureCSSTabsProvider::enqueueStyles();

  // ...

}
 copy
// enqueue the minified version
PureCSSTabsProvider::enqueueStyles();

// enqueue the flat version
PureCSSTabsProvider::enqueueStyles( false );

// return the absolute path of the minified css
PureCSSTabsProvider::css();

// return the absolute path of the flat css
PureCSSTabsProvider::css();
 copy
    /**
     * Display tabs by array
     *
     *     self::tabs(
     *       'tab-1' => [ 'label' => 'Tab 1', 'content' => 'Hello', 'selected' => true ],
     *       'tab-2' => [ 'label' => 'Tab 1', 'content' => 'Hello' ],
     *       ...
     *     );
     *
     * @param array $array
     */
    WPKirk\PureCSSTabs\PureCSSTabsProvider::tabs(
      'tab-1' => [ 'label' => 'Tab 1', 'content' => 'Hello', 'selected' => true ],
      'tab-2' => [ 'label' => 'Tab 1', 'content' => 'Hello' ],
      ...
    );
 copy
  /**
   * Display the open tab.
   *
   * @param string $label    The label of tab.
   * @param null   $id       Optional. ID of tab. If null, will sanitize_title() the label.
   * @param bool   $selected Optional. Default false. TRUE for checked.
   */
   public static function openTab( $label, $id = null, $selected = false ) {}
html copy
<!-- main tabs container -->
<div class="wpbones-tabs">

  <!-- first tab -->
   echo WPkirk()->view( 'folder.tab1' ) 
html copy
<div class="wpbones-tabs">

   WPKirk\PureCSSTabs\PureCSSTabsProvider::openTab( 'Tab 1', null, true )