0

I am trying to create a custom module where I have created an asset uploader field. Images are getting uploaded with that field but not saved.

class Settings extends Model
{
   // Public Properties
    // =========================================================================
    public $imageId = [];


    // Returns the validation rules for attributes.
    public function rules()
    {
        return [
            [['imageId'], 'required'],

           
        ];
    }

    public function getimages()
    {
        return Craft::parseEnv(trim(Ig::getInstance()->getSettings()->imageId));

        }
    
}

4
  • Please post your code and the specific error that you're experiencing. Impossible to help you with so little information.
    – MoritzLost
    Feb 16, 2022 at 13:25
  • I have added my code as well now for more clarification the last function get images is not working for saving.
    – Eira
    Feb 16, 2022 at 13:56
  • Have you checked?
    – Eira
    Mar 1, 2022 at 6:53
  • If you want people to help with a complex problem, you have to put a little effort into explaining it. The code you posted is meaningless without context. Where and how is this Settings model used? How are you calling it, what are you expecting to see, what are you actually seeing? What have you tried to solve it? What are specific errors/issues you're stuck on? Right now the question looks like a 'do my homework for me' request, which nobody likes to answer.
    – MoritzLost
    Mar 1, 2022 at 8:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy