PHP code example of moura / bladecomponents

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

    

moura / bladecomponents example snippets


class NameComponent extends BladeComponent{
  function inputs()
  {
    return [
    
    ];
  }
  
  function buttons()
  {
    return [
    
    ];
  }
  
  function data()
  {
    return [
    
    ];
  }
}

function inputs()
{
  return [
    'foolabel' => Form::label(
        'fooSelect',
        'Text for label',
        [
            'class' => 'foo-class'
        ]
    ),
    'fooSelect' => Form::select(
        'fooSelect',
        [' '],
        null,
        [
            'multiple' => null,
            'class'    => 'foo-class'
        ]
    )
  ];
}

function buttons()
{
  return [
    'submitButton' => Form::submit('Click Me!'),
    'resetButton' => Form::reset('Clear form')
  ];
}

function data()
{
  return [
    'fooObject' => app(FooNameSpace\FooClass)
  ];
}
css
.componentName-class div{
  @if(array_key_exists('fooLabel',$inputs))
    border-color : red;
  @else
    border-color : blue;
  @endif;
}