0

I am new at PHP and currently now i am working on moodle LMS tool.

I am referring view.php of scorm package and dont know why $cm->course this is used in php.

Please help.

Thanks in Advance

Swanand Taware
  • 723
  • 2
  • 7
  • 32

4 Answers4

1

Have a look here "->" means accessing the $cm object property course

SergkeiM
  • 3,934
  • 6
  • 36
  • 69
1

$cm is an object, and course is a variable. Here you can see brief of PHP syntax with objects: http://php.net/manual/en/language.types.object.php

Daimos
  • 1,473
  • 10
  • 28
1

PHP has two Object Operator namely -> and ::

-> is used when you are trying to call a method on an Instance and / or access an Instance property.

:: is used when you want to call a static method or call a parent class's version of a method within a child class.

Reference: https://www.codeproject.com/questions/196270/what-is-meant-by-symbol-in-php

Note: I googled your exact question and got this result!

masterFly
  • 1,072
  • 12
  • 24
1

It is "object operator" - T_OBJECT_OPERATOR. It is used to access properties and methods of class on an object.