{"id":15441579,"url":"https://github.com/mudler/mojolicious-plugin-viewbuilder","last_synced_at":"2025-10-10T20:32:52.400Z","repository":{"id":20461624,"uuid":"23738950","full_name":"mudler/Mojolicious-Plugin-ViewBuilder","owner":"mudler","description":"a Mojolicious plugin that allows to chain templates generated by other plugins","archived":false,"fork":false,"pushed_at":"2015-01-26T23:03:29.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T20:32:13.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mudler.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-06T16:22:22.000Z","updated_at":"2025-08-27T12:58:26.000Z","dependencies_parsed_at":"2022-07-31T20:38:10.106Z","dependency_job_id":null,"html_url":"https://github.com/mudler/Mojolicious-Plugin-ViewBuilder","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mudler/Mojolicious-Plugin-ViewBuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2FMojolicious-Plugin-ViewBuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2FMojolicious-Plugin-ViewBuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2FMojolicious-Plugin-ViewBuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2FMojolicious-Plugin-ViewBuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudler","download_url":"https://codeload.github.com/mudler/Mojolicious-Plugin-ViewBuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2FMojolicious-Plugin-ViewBuilder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005272,"owners_count":26083863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T19:21:17.287Z","updated_at":"2025-10-10T20:32:52.368Z","avatar_url":"https://github.com/mudler.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mudler/Mojolicious-Plugin-ViewBuilder.svg?branch=master)](https://travis-ci.org/mudler/Mojolicious-Plugin-ViewBuilder)\n# NAME\n\nMojolicious::Plugin::ViewBuilder - a Mojolicious plugin that allows to chain templates generated by other plugins\n\n# SYNOPSIS\n\n    #Load the plugin\n\n    # - Mojolicious\n    $self-\u003eplugin('ViewBuilder');\n\n    # - Mojolicious::Lite\n    plugin 'ViewBuilder';\n\n    # then, use it in your template, declare a new area, labeled \"profile\"\n    \u003c%= pluggable_view 'profile' %\u003e\n\n    # now, in the plugin, that will attach the new helper to the view\n\n    sub register {\n        my ( $self, $app, $conf ) = @_;\n\n        $app-\u003ehelper(\n            test =\u003e sub {\n                shift-\u003erender_to_string( \"test\", some_data =\u003e 1 );\n            }\n        );\n\n        #attach the test helper to the view \"profile\"\n        $app-\u003eadd_view( \"profile\", \"test\" );\n\n    }\n    1;\n\n    # or you can append a callback\n\n    sub register {\n        my ( $self, $app, $conf ) = @_;\n        $app-\u003eadd_view(\n            profile =\u003e sub {\n                shift-\u003erender_to_string( \"test\", some_data =\u003e 42 );\n            }\n        );\n    }\n    1;\n    __DATA__\n    @@ test.html.ep\n    huuuray!\n    % if( stash(\"some_data\") and stash(\"some_data\")==42){\n     double it!\n    % }\n\n# DESCRIPTION\n\n[Mojolicious::Plugin::ViewBuilder](https://metacpan.org/pod/Mojolicious::Plugin::ViewBuilder) is a [Mojolicious](https://metacpan.org/pod/Mojolicious) plugin. Chains templates generated by other plugins, associating them within the view. This is useful only if your workflow is to reap into little pieces the webapp (e.g. in plugins)\n\n# METHODS\n\n[Mojolicious::Plugin::ViewBuilder](https://metacpan.org/pod/Mojolicious::Plugin::ViewBuilder) inherits all methods from\n[Mojolicious::Plugin](https://metacpan.org/pod/Mojolicious::Plugin) and implements the following new ones.\n\n## pluggable\\_view\n\n    \u003c%=pluggable_view \"profile\" %\u003e\n\nWill render all the attached plugin associated within the view\n\n## add\\_view\n\n    $app-\u003eadd_view(\"view\",\"helper\");\n    $app-\u003eadd_view(view =\u003e sub{shift-\u003erender_to_string(\"Hello mojolicious!\")});\n\nAttach the \"helper\" within the \"view\"\n\n# LICENSE\n\nCopyright (C) mudler.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nmudler \u003cmudler@dark-lab.net\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudler%2Fmojolicious-plugin-viewbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudler%2Fmojolicious-plugin-viewbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudler%2Fmojolicious-plugin-viewbuilder/lists"}