PHP code example of monkdev / monkcms

1. Go to this page and download the library: Download monkdev/monkcms 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/ */

    

monkdev / monkcms example snippets


$cms = new Monk\Cms(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));

$cms->setConfig(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));

Monk\Cms::setDefaultConfig(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));

$defaultConfig = array(
    'request'    => null, // Override the default Http Request library used in the package
    'siteId'     => null, // Required
    'siteSecret' => null, // Required
    'cmsCode'    => 'EKK', // Override the default CMS Code
    'cmsType'    => 'CMS', // Override the default CMS Type (Sermon Cloud/Church Cloud vs CMS Content)
    'url'        => 'http://api.monkcms.com' // Override the default API Endpoint
);

$content = $cms->get('sermon/detail/sermon-slug');

$content = $cms->get('sermon/list', array(
    'nonfeatures' => true,
    'howmany'     => 5
));

$content = $cms->get(array(
    'module'  => 'sermon',
    'display' => 'list',
    'howmany' => 5
));

$cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'howmany' => 1,
  'page' => 1,
  'show' => "___starttime format='g:ia'__ __endtime format='g:ia'__",
));

$cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'howmany' => 1,
  'page' => 1,
  'show' => [
    "__starttime format='g:ia'__",
    "__endtime format='g:ia'__"
  ]
));