You are here

public function CourseObjectTest::take in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_test/src/Plugin/course/CourseObject/CourseObjectTest.php \Drupal\course_test\Plugin\course\CourseObject\CourseObjectTest::take()
  2. 3.x modules/course_test/src/Plugin/course/CourseObject/CourseObjectTest.php \Drupal\course_test\Plugin\course\CourseObject\CourseObjectTest::take()

Course object entry point for taking. This method should return a value corresponding to the type set in getTakeType().

Overrides CourseObject::take

File

modules/course_test/src/Plugin/course/CourseObject/CourseObjectTest.php, line 22

Class

CourseObjectTest
Plugin annotation @CourseObject( id = "course_test_object", label = "Test course object", handlers = { "fulfillment" = "\Drupal\course_test\Plugin\course\CourseObject\CourseObjectTestFulfillment" } )

Namespace

Drupal\course_test\Plugin\course\CourseObject

Code

public function take() {
  return [
    '#markup' => t('I am a test course object with the title @title', array(
      '@title' => $this
        ->getOption('title'),
    )),
  ];
}