alyssa_00515427
alyssa_00515427

I have this error T_T


We're sorry, but an unhandled error occurred. Please see the details below.
Method name must be a string

plugins\contest\form\traits\ComponentUtils.php line 84

er.shajidkhan13974
er.shajidkhan13974

I have a video gallery page in my website but i want to add videos from backend and not at cms page.is there any plugin for that? if not how to create plugin for the same? i am totally new dont know how to create plugin

Iocare
Iocare

I'm using clone of responsiv available at https://octobercms.com/plugin/netsti-uploader

Make sure this component is placed by code initiation not by dragging it on page.. A better way is to add it dynamically by using following code on onInit of code section of a page. Assuming we want to add avatar/profile pic for account page, add :

{% component 'imageUploader' %}

anywhere you want to put upload box. For example in my case I've added above line in update.htm partial (overridden) of user component. This will display upload box in account page above update account form.

After this add following code to account page code section:

function onInit()
{
    $user = Auth::getUser();
    if($user){
        $component = $this->addComponent(
            'NetSTI\Uploader\Components\ImageUploader',
            'imageUploader',
            ['modelClass'=>'RainLab\User\Models\User','modelKeyColumn'=>'avatar', 'deferredBinding' => false]
        );

        $component->bindModel('avatar', $user);
    }
}

Here modelClass is the class in which to relate picture (avatar) and modelKeyColumn is the column name to which this pic to relate.

EDIT: add code in onInit function instead of onStart.

judeudemolidor
judeudemolidor

ERROR on my app help plz Alt text

Last updated

judeudemolidor
judeudemolidor

judeudemolidor said:

ERROR on my app help plz Alt text

when i try use (somenting wrong on account user) Alt text

janedoe
janedoe

iocare said:

I'm using clone of responsiv available at https://octobercms.com/plugin/netsti-uploader

Make sure this component is placed by code initiation not by dragging it on page.. A better way is to add it dynamically by using following code on onInit of code section of a page. Assuming we want to add avatar/profile pic for account page, add :

{% component 'imageUploader' %}

anywhere you want to put upload box. For example in my case I've added above line in update.htm partial (overridden) of user component. This will display upload box in account page above update account form.

After this add following code to account page code section:

function onInit()
{
   $user = Auth::getUser();
   if($user){
       $component = $this->addComponent(
           'NetSTI\Uploader\Components\ImageUploader',
           'imageUploader',
           ['modelClass'=>'RainLab\User\Models\User','modelKeyColumn'=>'avatar', 'deferredBinding' => false]
       );

       $component->bindModel('avatar', $user);
   }
}

Here modelClass is the class in which to relate picture (avatar) and modelKeyColumn is the column name to which this pic to relate.

EDIT: add code in onInit function instead of onStart.

Call to undefined method October\Rain\Database\QueryBuilder::getDefaultFileTypes() it is giving this error not getting clear how to use

janedoe
janedoe

Dear Developer i have used resposiv/uploader plugin and created model.I also import namespace in plugin registration file plugin .php as use Project but still i am getting this error.Class Project not found.It will be very helpful if this plugin works.

janedoe
janedoe

RomaldyMinaya said:

Hi everyone,

I tryed implementing the responsiv/uploader but after the image has been uploaded, it throws en exception:

The code is:

function onStart()
{
   $this->imageUploader->bindModel('avatar', $this->user);
}

Note that I'm using this in a page that has the account component dropped inside so I can use $this->user to refference the current user.

Dear sir whenever i use this plugin i got this error class Project not found error.but i have created the model named as project and also called in my plugin using use.i am stuck what to do?

spinkalher
spinkalher

Thank you It's working

We add this line...add pass session key

public function onSave() {
return ['error' => \KRYPTOS\donor\Models\Donor::create(post('Donor'), post('_session_key'))];
}

maxDubovsky
maxDubovsky

spinkalher12320398 said:

Thank you It's working

We add this line...add pass session key

public function onSave() {
return ['error' => \KRYPTOS\donor\Models\Donor::create(post('Donor'), post('_session_key'))];
}

You mean for deffered bindings it's working ? Have you tried reusing it from another component ? I have problems there with defered bindings (((

spinkalher
spinkalher

maxDubovsky said:

spinkalher12320398 said:

Thank you It's working

We add this line...add pass session key

public function onSave() {
return ['error' => \KRYPTOS\donor\Models\Donor::create(post('Donor'), post('_session_key'))];
}

You mean for deffered bindings it's working ? Have you tried reusing it from another component ? I have problems there with defered bindings (((

I have injected fileuploader component in my CustomComponent and it works please let me know what issue you are facing.

janedoe
janedoe

finally the plugin starts working but getting following error. 1.in single file upload component it uploads file but preview only title of the file. 2.In multiple file upload component it uploads all type pictur as well as other files but as i refresh page all dissapear.

SeriousKen
SeriousKen

I know this thread is a bit old, but I found none of the plugins met my needs so I submitted a pull request https://github.com/octobercms/october/pull/2857

This builds the request using FormData, which is supported by most modern browsers, and allows the use of native file upload submission by AJAX

saquib.rizwan27636
saquib.rizwan27636

Try picking the file from the laravel HTTP request variable.

$files = $request->file('photos');

And try uploading it via Laravel Store function.

$filename = $photo->store('photos');

Take a look at the multiple file upload in laravel article for a better explanation.

Last updated

aa

21-34 of 34