PHP code example of tparushev / carbon-section-builder

1. Go to this page and download the library: Download tparushev/carbon-section-builder 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/ */

    

tparushev / carbon-section-builder example snippets


class Home_Intro extends Base_Section {
	public function set_name() {
		$this->name = __( 'Home Intro2', 'crb' );
	}
	
	public function fields() {
		return array(
			Field::make( 'file', 'first_image', __( 'Image', 'crb' ) )
				->set_width( 50 ),
			Field::make( 'file', 'second_image', __( 'Image', 'crb' ) )
				->set_width( 50 ),
			Field::make( 'rich_text', 'content', __( 'Content', 'crb' ) ),
		);
	}
}