src/Page/Page.php
public function addSettings($section, array $settings = []): PageInterface
    {
        $currentSettings = $this->repository()->getSettings()->all();

        if (is_array($section)) {
            $settings = array_merge($currentSettings, $section);
        } else {
            $settings = array_merge($currentSettings, [$section => $settings]);
        }

        $this->repository()->setSettings($settings);

        // Set a default page view for handling
        // the settings. A user can still overwrite
        // the view.
        if ('page' === $this->ui()->getViewPath()) {
            $this->ui()->setView('options');
        }

        return $this;
    }
public function addSettings($section, array $settings = []): PageInterface
    {
        $currentSettings = $this->repository()->getSettings()->all();

        if (is_array($section)) {
            $settings = array_merge($currentSettings, $section);
        } else {
            $settings = array_merge($currentSettings, [$section => $settings]);
        }

        $this->repository()->setSettings($settings);

        // Set a default page view for handling
        // the settings. A user can still overwrite
        // the view.
        if ('page' === $this->ui()->getViewPath()) {
            $this->ui()->setView('options');
        }

        return $this;
    }
public function addSettings ( $ section , array $ settings = [ ] ) : PageInterface { $ currentSettings = $ this -> repository ( ) -> getSettings ( ) -> all ( ) ; if ( is_array ( $ section ) ) { $ settings = array_merge ( $ currentSettings , $ section ) ; } else { $ settings = array_merge ( $ currentSettings , [ $ section => $ settings ] ) ; } $ this -> repository ( ) -> setSettings ( $ settings ) ; // Set a default page view for handling // the settings. A user can still overwrite // the view. if ( 'page' === $ this -> ui ( ) -> getViewPath ( ) ) { $ this -> ui ( ) -> setView ( 'options' ) ; } return $ this ; }
Add settings to the page.

@param string|array $section
@param array        $settings

@return PageInterface
Add settings to the page .