PHP code example of supseven / theme-dev

1. Go to this page and download the library: Download supseven/theme-dev library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

supseven / theme-dev example snippets


class MyClass {
    public function __construct(
        protected readonly \Supseven\ThemeDev\Utility\LipsumGenerator $lipsumGenerator,
    ) {
    }

    public function oneLine(): string
    {
        return $this->lipsumGenerator->generate();
    }

    public function twoParagraphs(): string
    {
        $html = '';

        foreach ($this->lipsumGenerator->generate(2, asArray: true) as $line) {
            $html .= "<p>$line</p>"
        }

        return $html;
    }
}