Jason Huck Posted April 12, 2016 Posted April 12, 2016 What's the correct equivalent of this? $foo = new Page(); $foo->name->setLanguageValue($lang, wire('sanitizer')->pageName($value)); I get that 'name' isn't a field like title, etc. and thus doesn't have the setLanguageValue method. I also see where the data is stored in the database. But what is the proper way to set that value via the API? Thanks! Jason
Jason Huck Posted April 12, 2016 Author Posted April 12, 2016 Looks like $foo->set('name$lang', wire('sanitizer')->pageName($value)); does the trick. 1
kixe Posted April 13, 2016 Posted April 13, 2016 And those ones too: $foo->setLanguageValue($lang,'name', wire('sanitizer')->pageName($value)); $foo->{"name$lang"} = wire('sanitizer')->pageName($value);
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now