This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

perseus.lonten
perseus.lonten

Hey, I created a plugin with builder.

My model : http://kopy.io/HpSbg My field : http://kopy.io/doYkB

I wanna show one more field in my backend plugin page. I should use another table for it. How can i add it?

Thanks : )

philipptempel
philipptempel

What do you mean by "showing one more field"? Do you mean like an input field? If so then you just need to update your database schema using the database tab of the builder, add the respective column, done with this part. Then, in the model's fields.yaml definition, you need to add the field - as a text or textarea or whatever kind of field you want it to be.

PS: The keys of the options of field kullanicidurum should be way shorter. Generally you wouldn't want your keys to be something like you have it right now (i.e., being the same as the values) but you want something shorter. Either numeric keys or an abbreviation of your values if applicable.

perseus.lonten
perseus.lonten

Thanks for reply.

I have searched that for 3 hours then i find a way to what should i do but i cant still do it. I have 2 tables. Users and signatures. I should relation these 2 tables and show that my backend panel. I use relation widget but it doesnt work.

I got this error.

Model 'Ugur\Acileylem\Models\Kullanici' does not contain a definition for 'signatures'.

I am searching still. How can i make a relation between my users table and my signatures table. Then i am gonna show it on my fields.yaml.

philipptempel
philipptempel

You need to implement the RelationController and configure it properly. It's explained in the docs or in this really great video tutorial by Samuel Georges. The latter resource is something I would highly recommend you to view the video. It explains very well how to relate models with different relationship types.

perseus.lonten
perseus.lonten

Thank you a lot.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.