There are other ways to do this with injector, via property setters, or public properties.
- public $width
You can use injector to set this property after it has created the object. OR
- private $width;
- public function setWidth($width)
- $this->width = $width;
Both of these can be set via
- width: 80
(be aware I've stripped the namespaces for brevity)
you may need a capital W to match the setter function if you do that way.
I hope this has been informative, I must do work now :P
Do any of you know if there is a SS4 equivalent method for SS3's
(framework) JSONDataFormatter->convertDataObjectSet? (Converting SS3 module to SS4)
I just posted this question on the Silverstripe forum (about setting number of items pagination in Gridfield). If anyone can point me in the right direction for this that would be great: https://forum.silverstripe.org/t/girdfield-pagination-on-v4-x/2348
Silverstripe Version 4.4.4 Question: I’m having trouble setting the number of items per page on a Gridfield list in v4 Previously (v3) I would have done it like this: $gridFieldConfig->getComponentByType('GridFieldPaginator')->setItemsPerPage(50); I’ve added these two namespaces use SilverStripe\Forms\GridField\GridFieldConfig; use SilverStripe\Forms\GridField\GridFieldPaginator; but I get “Uncaught Error: Call to a member function setItemsPerPage() on null” Can anyone point me in ...Hide attachment content
Try changing to
@Neil Creagh I can't remember the exact details but you can do this via yml file. If you search the slack archive website you should find the message where someone here told me how to do it!
I think if you did this via YML, it would be a global change?
Global change would be ok in this case
In which case, looks like you can use
GridFieldPaginator.default_items_per_page config variable