Skip to main content
deleted 2 characters in body
Source Link
James Smith
  • 5.7k
  • 15
  • 15

This bothered me too until I switched to PHPStorm and started using this: https://github.com/nystudio107/craft-autocomplete.

If that's not an option and you fancy extending Twig, you can use php's get_class_methods function to return the methods of a passed-in object.

Ultimately though, given the deep inheritance tree from Yii's base objects, listing out 100s of methods that you'll mostly never touch is not all that helpful, I find. When you need to do something complicated, you're best off digging through the Class Reference - at least you'll get descriptions of what the methods do, and their parameters.

(Related, I often use the |keys() filter to dump out an object's properties.)

This bothered me too until I switched to PHPStorm and started using this: https://github.com/nystudio107/craft-autocomplete.

If that's not an option and you fancy extending Twig, you can use php's get_class_methods function to return the methods of a passed-in object.

Ultimately though, given the deep inheritance tree from Yii's base objects, listing out 100s of methods that you'll mostly never touch is not all that helpful, I find. When you need to do something complicated, you're best off digging through the Class Reference - at least you'll get descriptions of what the methods do, and their parameters.

(Related, I often use the |keys() filter to dump out an object's properties.)

This bothered me too until I switched to PHPStorm and started using this: https://github.com/nystudio107/craft-autocomplete.

If that's not an option and you fancy extending Twig, you can use php's get_class_methods function to return the methods of a passed-in object.

Ultimately though, given the deep inheritance tree from Yii's base objects, listing out 100s of methods that you'll mostly never touch is not all that helpful, I find. When you need to do something complicated, you're best off digging through the Class Reference - at least you'll get descriptions of what the methods do, and their parameters.

(Related, I often use the |keys filter to dump out an object's properties.)

Source Link
James Smith
  • 5.7k
  • 15
  • 15

This bothered me too until I switched to PHPStorm and started using this: https://github.com/nystudio107/craft-autocomplete.

If that's not an option and you fancy extending Twig, you can use php's get_class_methods function to return the methods of a passed-in object.

Ultimately though, given the deep inheritance tree from Yii's base objects, listing out 100s of methods that you'll mostly never touch is not all that helpful, I find. When you need to do something complicated, you're best off digging through the Class Reference - at least you'll get descriptions of what the methods do, and their parameters.

(Related, I often use the |keys() filter to dump out an object's properties.)