{"id":34,"date":"2014-11-23T12:22:39","date_gmt":"2014-11-23T15:22:39","guid":{"rendered":"https:\/\/antoniomachado.com.br\/blog\/?p=34"},"modified":"2014-11-23T19:27:30","modified_gmt":"2014-11-23T22:27:30","slug":"slim-micro-framework-php-para-criar-api","status":"publish","type":"post","link":"https:\/\/antoniomachado.com.br\/blog\/slim-micro-framework-php-para-criar-api\/","title":{"rendered":"Slim, micro framework php para criar api"},"content":{"rendered":"<p>Para utilizar o micro framework php Slim basta que seu servidor web esteja rodando o php 5.3 ou superior, ter acesso a altera\u00e7\u00f5es no .htaccess e pronto, baixe o Slim e inclua-o em seu projeto.<\/p>\n<p>Fa\u00e7a download da \u00faltima vers\u00e3o est\u00e1vel neste link:\u00a0<a href=\"https:\/\/github.com\/codeguy\/Slim\/zipball\/master\">https:\/\/github.com\/codeguy\/Slim\/zipball\/master<\/a><\/p>\n<p>Montei um\u00a0trecho de c\u00f3digo para demonstrar a facilidade deste framework.<\/p>\n<p><!--?php <\/p-->\n<p>&lt;?php<\/p>\n<p>include &#8216;Slim\/Slim.php&#8217;;<\/p>\n<p>\/\/inicie uma inst\u00e2ncia do Slim<br \/>\n$app = new \\Slim\\Slim();<\/p>\n<p>\/\/defina uma rota<br \/>\n$app-&gt;get(&#8216;\/ola\/:nome&#8217;, function ($nome) {<br \/>\necho &#8220;Ol\u00e1, $nome&#8221;;<br \/>\n});<\/p>\n<p>\/\/execute<br \/>\n$app-&gt;run();<\/p>\n<p>?&gt;<\/p>\n<p>Documenta\u00e7\u00e3o do Slim Framework: <a href=\"http:\/\/docs.slimframework.com\/\">http:\/\/docs.slimframework.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para utilizar o micro framework php Slim basta que seu servidor web esteja rodando o php 5.3 ou superior, ter acesso a altera\u00e7\u00f5es no .htaccess e pronto, baixe o Slim e inclua-o em seu projeto. Fa\u00e7a download da \u00faltima vers\u00e3o est\u00e1vel neste link:\u00a0https:\/\/github.com\/codeguy\/Slim\/zipball\/master Montei um\u00a0trecho de c\u00f3digo para demonstrar a facilidade deste framework. &lt;?php include [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":6,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions\/41"}],"wp:attachment":[{"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/antoniomachado.com.br\/blog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}