PHP code example of ferndev / phpprogrammingcontrols

1. Go to this page and download the library: Download ferndev/phpprogrammingcontrols 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/ */

    

ferndev / phpprogrammingcontrols example snippets


$tabs = (new HtmlTabs())->setFramework('bootstrap');
$tabs->addTab('Tab1', '#p1', true)->addTab('Tab2', '#p2');
$tabs->setTabContent('p1', new HtmlDiv('Tab1 content...'));
$tabs->setTabContent('p2', new HtmlDiv('Tab2 content...'));
// 

$tabs = (new HtmlTabs())->setFramework('tailwind'); // 2');
$tabs->setTabContent('p1', new HtmlDiv('Tab1 content...'));
$tabs->setTabContent('p2', new HtmlDiv('Tab2 content...'));

$tabs = (new HtmlTabs('react-tabs'))->setFramework('react');
$tabs->addTab('Tab1', '#p1', true)->addTab('Tab2', '#p2');
$tabs->setTabContent('p1', new HtmlDiv('Tab1 content...'));
$tabs->setTabContent('p2', new HtmlDiv('Tab2 content...'));
// load examples/js/react-tabs-binder.jsx with React + Babel

$tabs = (new HtmlTabs('my-tabs'))->setFramework('vanilla')->setClasses([
  'ulClass' => 'tabs',
  'linkClass' => 'tab',
  'linkActiveClass' => 'tab--active',
  'paneHiddenClass' => 'hidden'
]);
$tabs->addTab('One', '#p1', true)->addTab('Two', '#p2');
$tabs->setTabContent('p1', new HtmlDiv('One'));
$tabs->setTabContent('p2', new HtmlDiv('Two'));