Giter Site home page Giter Site logo

Comments (7)

trntv avatar trntv commented on August 24, 2024

Покажите конфиг виджета и конфиг бехейвора.

from yii2-file-kit.

kharalampidi avatar kharalampidi commented on August 24, 2024
'fileStorage' => [
            'class' => '\trntv\filekit\Storage',
            'baseUrl' => '@storageUrl/source',
            'filesystem' => [
                'class' => 'common\components\filesystem\LocalFlysystemBuilder',
                'path' => '@storage/web/source'
            ],
            'as log' => [
                'class' => 'common\behaviors\FileStorageLogBehavior',
                'component' => 'fileStorage'
            ]
        ],

Из стартеркита..
Ну а в форме:

>widget(
        Upload::classname(),
        [
            'url' => ['logo-upload'],
        ]
    )

Если в UserProfile из Стартер Кита добавить такие поля (name, type...) - тоже самое произойдет..

Я те конфиги вообще скинул?)

from yii2-file-kit.

trntv avatar trntv commented on August 24, 2024

Вижу, сейчас разберемся
а нет, не вижу :-)

from yii2-file-kit.

trntv avatar trntv commented on August 24, 2024

То есть $_POST уходит правильно, судя по первому сообщению, а в модель сохраняется неправильно?

Покажите еще функцию behaviors() из вашей модели

from yii2-file-kit.

kharalampidi avatar kharalampidi commented on August 24, 2024

Сейчас я в чистом Starter Kit..

 public function behaviors()
    {
        return [
            'picture' => [
                'class' => UploadBehavior::className(),
                'attribute' => 'picture',
                'pathAttribute' => 'avatar_path',
                'baseUrlAttribute' => 'avatar_base_url'
            ]
        ];
    }

Я добавил поля type,name в модель UserProfile для проверки. Сохранил модель, и собственно эти поля заполнились данными с файла..
Картинка

from yii2-file-kit.

kharalampidi avatar kharalampidi commented on August 24, 2024

А POST приходит правильный..

from yii2-file-kit.

trntv avatar trntv commented on August 24, 2024

Теперь можно сделать так:

'picture' => [
                'class' => UploadBehavior::className(),
                'attribute' => 'picture',
                'pathAttribute' => 'avatar_path',
                'baseUrlAttribute' => 'avatar_base_url',
                'typeAttribute' => false,
                'sizeAttribute' => false,
                'nameAttribute' => false,
                'orderAttribute' => false
            ]

from yii2-file-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.