PHP code example of pixney / swiper_block-extension
1. Go to this page and download the library: Download pixney/swiper_block-extension 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/ */
pixney / swiper_block-extension example snippets
use Anomaly\Streams\Platform\Database\Migration\Migration;
class ChangeSwiperRatio extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$field = $this->fields()->findBySlugAndNamespace('image', 'swiper_block');
$field->setAttribute('config', [
'aspect_ratio'=> '16:9' // Change this to whatever you want
])->save();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$field = $this->fields()->findBySlugAndNamespace('image', 'swiper_block');
$field->setAttribute('config', [
'aspect_ratio'=> '16:10'
])->save();
}
}