PHP code example of michaelbmuller / 50001-ready-guidance-test

1. Go to this page and download the library: Download michaelbmuller/50001-ready-guidance-test 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/ */

    

michaelbmuller / 50001-ready-guidance-test example snippets



DOE_50001_Ready\Guidance;

//Load guidance
$guidance = new Guidance();

//Load alternate language (example: español) 
$guidance = new Guidance('es'); 

//Set Custom Task Tips
$guidance->setCustomTips($customTips);

//Section Related Functions
$sections = $guidance->getSections();
$sectionName = $guidance->getSectionName($sectionCode);
$previousSectionCode = $guidance->previousSection($sectionCode, $dashboardCode = 'dashboard');
$nextSectionCode = $guidance->nextSection($sectionCode, $dashboardCode = 'dashboard');

//Get All Tasks
$tasks = $guidance->getTasks();

//Get Section Tasks
$tasks = $guidance->getTasks([sectionCode]);

//Get Task
$task = $guidance->getTask([taskId]);
$task = $guidance->getTaskByMenuName($menuName);

//Or load Task 1 directly
$task = Task::load(1,'en');


/** @var \DOE_50001_Ready\Task $task */
//Available Task Data 
$task->id();
$task->getMenuName();
$task->getTitle();
$task->language_requested;
$task->language_displayed;

/** ONLY AVAILABLE WHEN TASKS LOADED THROUGH GUIDANCE */
$task->sectionCode;
$task->section;
$task->relatedIsoSections;
$task->prerequisites;
$task->leadsTo;
$task->custom_tips;
//customTips Must be externally loaded with $guidance->setCustomTips($customTips);
$task->resources;

//With Processed Markup Text
$task->getGettingItDone();
$task->getTaskOverview();
$task->getFullDescription();
$task->getOtherIsoTips();
$task->getEnergyStarTips();
$task->getCustomTips();


/** @var \DOE_50001_Ready\Resource $resource */
//Available Task Data 
$resource->id;
$resource->name;
$resource->file_type;
$resource->short_description;
$resource->file_name;
$resource->link;

//Create a new Markup Processor that implements the rInterface

//Inject the new Markup Processor into the Guidance or Tasks
$guidance = new Guidance($language, NewMarkupProcessor::class);
$task = new Task::load($task_id, $language, NewMarkupProcessor::class);

[task](Menu Name)

[resource](Resource_Code_Name)

[Accordion](Title of Accordion Content)
**Accordion Content**
[Accordion End]

[Learn More](Title of Learn More Content)
**Learn More Content**
[Learn More End]