Maslosoft Framework Documentation
Flexible Application Foundation
Proportions Renderer
This renderer displays apropriately scaled squares with common movie/photo proportions list. These squares are active - when clicked will set proper value of bindable field.
1:1
6:5
5:4
4:3
11:8
1.41:1
1.43:1
3:2
16:10
16.18:10
5:3
16:9
1.85:1
2.35:1
2.414:1
2.76:1
4:1
Example div with proportions applied:
To get such result as above example, add @FormRenderer annotation with class of Proportions for field containing proportions value. This value is a string with ratio noted as width:height
together - separated with colon.
Example usage on model:
/**
* @Label('Proportions')
* @FormRenderer(Proportions)
* @see Proportions
* @var string
*/
public $proportions;
Then render with form:
$form = ActiveForm::widget([
'model' => new ExampleProportionsRenderer()
]);
echo $form->renderField('proportions');