1. Go to this page and download the library: Download wikimedia/codex 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/ */
wikimedia / codex example snippets
$accordion = $codex
->accordion()
->setTitle( "Accordion Example" )
->setDescription( "This is an example of an accordion." )
->setContentHtml(
$codex
->htmlSnippet()
->setContent( "<p>This is the content of the accordion.</p>" )
->build()
)
->setOpen( false )
->setAttributes( [
"class" => "foo",
"bar" => "baz",
] )
->build()
->getHtml();
echo $accordion;
kimedia\Codex\Utility\Codex
$codex = new Codex();
$accordion = $codex
->accordion()
->setTitle( "Accordion Example" )
->setDescription( "This is an example of an accordion." )
->setContentHtml(
$codex
->htmlSnippet()
->setContent( "<p>This is the content of the accordion.</p>" )
->build()
)
->setOpen( false )
->setAttributes( [
"class" => "foo",
"bar" => "baz",
] )
->build()
->getHtml();
echo $accordion;
use Wikimedia\Codex\Contract\IWebRequest;
class SimpleWebRequest implements IWebRequest {
protected array $data;
public function __construct( array $data ) {
$this->data = $data;
}
public function getVal( string $name, $default = null ) {
return $this->data[$name] ?? $default;
}
}
use Wikimedia\Codex\Adapter\WebRequestAdapter;
// Initialize the request with $_GET parameters
$request = new SimpleWebRequest( $_GET );
// Adapt the SimpleWebRequest to work with Codex
$requestAdapter = new WebRequestAdapter( $request );
use Wikimedia\Codex\Utility\WebRequestCallbacks;
// Initialize WebRequestCallbacks
$callbacks = new WebRequestCallbacks( $requestAdapter );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.