{"id":18783687,"url":"https://github.com/tomkyle/responsivepicture","last_synced_at":"2025-12-20T18:30:17.469Z","repository":{"id":19947928,"uuid":"23214687","full_name":"tomkyle/ResponsivePicture","owner":"tomkyle","description":"A PHP wrapper for responsive HTML5 picture element","archived":false,"fork":false,"pushed_at":"2014-08-30T06:35:33.000Z","size":360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T11:45:36.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mhart/alpine-node","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomkyle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-08-22T05:59:58.000Z","updated_at":"2014-08-22T06:04:13.000Z","dependencies_parsed_at":"2022-08-17T15:41:22.105Z","dependency_job_id":null,"html_url":"https://github.com/tomkyle/ResponsivePicture","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FResponsivePicture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FResponsivePicture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FResponsivePicture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FResponsivePicture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomkyle","download_url":"https://codeload.github.com/tomkyle/ResponsivePicture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699579,"owners_count":19682574,"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","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-11-07T20:40:08.101Z","updated_at":"2025-12-20T18:30:17.422Z","avatar_url":"https://github.com/tomkyle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Responsive Picture Elements\n\n[![Build Status](https://travis-ci.org/tomkyle/ResponsivePicture.svg?branch=master)](https://travis-ci.org/tomkyle/ResponsivePicture)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/tomkyle/ResponsivePicture/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/tomkyle/ResponsivePicture/?branch=master)\n[![Coverage Status](https://coveralls.io/repos/tomkyle/ResponsivePicture/badge.png?branch=master)](https://coveralls.io/r/tomkyle/ResponsivePicture?branch=master)\n\nA PHP wrapper for HTML5 picture element. See:\n\n- Scott Jehl's [Picturefill – A responsive image polyfill](http://scottjehl.github.io/picturefill/)\n- [Picturefill on Github](https://github.com/scottjehl/picturefill)\n\n\n\n##Installation\n\nThis library has no dependencies except from `satooshi/php-coveralls` for testing. Install from command line or `composer.json` file:\n\n#####Command line\n    \n    composer require tomkyle/responsivepicture\n\n#####composer.json\n    \"require\": {\n        \"tomkyle/responsivepicture\": \"~1.2\"\n    }\n\n\n\n##Getting started\n\n    \u003c?php\n    use \\tomkyle\\ResponsivePicture\\MinWidthSource;\n    use \\tomkyle\\ResponsivePicture\\ResponsivePicture;\n    use \\tomkyle\\ResponsivePicture\\ResponsivePictureView;\n\n    $pic = new ResponsivePicture( '//placehold.it/300x300', \"Sample image\");\n    \n    $pic-\u003eadd( new MinWidthSource(1200, '//placehold.it/1200x1200, //placehold.it/2400x2400 2x'));\n    $pic-\u003eadd( new MinWidthSource(800,  '//placehold.it/800x800,   //placehold.it/1600x1600 2x'));\n    $pic-\u003eadd( new MinWidthSource(480,  '//placehold.it/480x480,   //placehold.it/960x960   2x'));\n    ?\u003e\n    \n    \n##Create output\nJust create a `ResponsivePictureView` instance and echo it, optionally passing your `ResponsivePicture` object.\nYou may start with no parameters and later set the ResponsivePicture, either by setter method or invoking:\n\n    \u003c?php\n    // One-line call\n    echo new ResponsivePictureView( $pic );\n\t\n\t// Use setter method\n\t$foo = new ResponsivePictureView;\n\t$foo-\u003esetPicture( $pic_view );\n\techo $foo;\n\t\n\t// Or use with __invoke:\n    $bar = new ResponsivePictureView;\n    echo $bar( $pic1 );\n    echo $bar( $pic2 );    \n    echo $bar( $pic3 );    \n\t?\u003e\n\t\n\t\n##Testing\nGo to package root, install dependencies with `composer update` or `install`, run `phpunit`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fresponsivepicture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomkyle%2Fresponsivepicture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fresponsivepicture/lists"}