Ads 4 You

How to install Composer packages ignoring PHP version requirements

Email Id : phpmk888@gmail.com

 A new feature in Composer v2 allows you to selectively ignore platform requirements.

Example to installation : Yii2 time picker


In Yii2, integrating a time picker typically involves using extensions or libraries designed for this purpose. One popular extension for Yii2 that provides time picker functionality is "kartik-v/yii2-widget-timepicker.

Here's a general idea of how you might use it:

Installation: First, you'll need to install the extension. You can do this via Composer by running the following command:

composer require kartik-v/yii2-widget-timepicker

Usage: After installation, in your Yii2 view file where you want the time picker, you can use it like this:

use kartik\time\TimePicker;

// Use the TimePicker widget in your form
echo $form->field($model, 'time_attribute')->widget(TimePicker::class, [
    'pluginOptions' => [
        'showSeconds' => true, // Adjust options based on your needs
        // Other options as needed
    ]
]);


Solution: 

 you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.


composer --ignore-platform-req=ext-gd require kartik-v/yii2-widget-timepicker

composer --ignore-platform-req=php --ignore-platform-req=ext-zip --ignore-platform-req=ext-gd require kartik-v/yii2-widget-timepicker:v1.0.0









Comments