Closed amismailz closed 9 years ago
I have no estimates...
Because of a lack of free time, I am not actively working on it right now.
But something was already done:
Remaining part(almost entire server side part):
Probably I will do something on next weekend, but no guarantee...
If you need it, urgent, or you just want to help - you are welcome.
To install current extension version, you will need following steps:
"repositories": [
{
"url": "https://github.com/zxbodya/yii2-gallery-manager.git",
"type": "git"
}
],
"zxbodya/yii2-gallery-manager": "*@dev"
Run composer update
class m140930_003227_gallery_manager extends zxbodya\yii2\galleryManager\migrations\m140930_003227_gallery_manager
{
}
And run it.
namespace backend\controllers;
use zxbodya\yii2\galleryManager\GalleryManagerAction;
use zxbodya\yii2\galleryManager\models\Gallery;
class TestController extends \yii\web\Controller
{
public function actions()
{
return [
'galleryApi' => [
'class' => GalleryManagerAction::className(),
],
];
}
public function actionGallery()
{
$gallery = Gallery::findOne(['id' => 1]);
if (empty($gallery)) {
$gallery = new Gallery();
$gallery->id = 1;
}
$gallery->name = true;
$gallery->description = true;
$gallery->setVersions(
[
'small' => [
'resize' => [200, null],
],
'medium' => [
'resize' => [800, null],
]
]
);
$gallery->save(false);
return $this->render('gallery', ['gallery' => $gallery]);
}
}
View
<?php
/* @var $this yii\web\View */
use zxbodya\yii2\galleryManager\GalleryManager;
use zxbodya\yii2\galleryManager\models\Gallery;
/** @var Gallery $gallery */
?>
<h1>test/gallery</h1>
<?=
GalleryManager::widget(
[
'gallery' => $gallery,
'apiRoute' => 'test/galleryApi'
]
); ?>
About how to implement AR Behavior, and image versions - see this project https://github.com/zxbodya/yii2-image-attachment
I am planning to do something similar, in this extensions too.
OK, very good work man. I can dispense AR behavior now because its urgent for me, i'll test it. At all, go ahead with the remaining, with my best regards.
Just published, updated version.
It is fully working. But probably I will do some code cleanup soon.
Strong thanks for you Bogdan, hoping more achievements for you.
I hope you work more harder :) i really need it.