1. Go to this page and download the library: Download samsoncms/api 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/ */
samsoncms / api example snippets
class MyTable extends \samsoncms\api\MyGeneratedTable
{
protected $indexView = 'specify a path to index view file';
protected $rowView = 'specify a path to row view file';
}
// Creating an instance, with QueryInterface, ViewInterface and Entity identifier
$table = new MyTable($query, $this, $material->MaterialID)
/** @var \samsoncms\api\Field $fieldRecord Try to find additional field record */
$fieldRecord = \samsoncms\api\Field::byNameOrID('image')
if (isset($fieldRecord)) {
// Additional field has been found
}
/** @var \samsoncms\api\Field $fieldRecord Try to find additional field record */
if (\samsoncms\api\Field::byNameOrID('image', $fieldRecord)) {
// Additional field has been found
}
public function setFieldByID($fieldID, $value, $locale = DEFAULT_LOCALE)