Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Docs on the basics of the guts

Started by jeff milton 8 years ago · 3 replies · 551 views
8 years ago

Knowing very little about Twig or Grav (although I did a lot with Symfony some time ago), it is not clear where the controllers are for some things. I can see the more obvious controllers, like system/src/Grav/Common/Page/Page.php, but, for example, I do not know what is being called for the sidebar. The plugin only has a js in it, but somewhere something is calling the 'database' to get a list.

When I look in the twig I see, for example "content", which is obviously the content object sent pack from Grav\Common\Page::controller, but it is not clear where "related_path" comes from when used in relatedpages.html.twig ( {% for related_path, score in related_pages %} ).

Can someone point me to the docs that explain this, or better yet, the entire request/response cycle and the various places/steps it goes thru?

Thanks

8 years ago

YES! Thanks (regarding lifecycle)

I see.. so, the 'relatedpages.php' is the controller for the plugin, and the templates/partials/relatedpages.html.twig is the 'view'.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 66 18 hours ago
Support · by Anna, 3 days ago
2 72 21 hours ago
Support · by Justin Young, 22 hours ago
1 40 22 hours ago
Support · by Duc , 1 week ago
2 76 6 days ago
Support · by Colin Hume, 1 week ago
2 70 6 days ago