{"id":24511883,"url":"https://github.com/paulo-correia/smarty_help","last_synced_at":"2025-09-02T10:43:48.351Z","repository":{"id":134106212,"uuid":"194948149","full_name":"paulo-correia/Smarty_Help","owner":"paulo-correia","description":"Smarty Template - Help","archived":false,"fork":false,"pushed_at":"2019-07-02T23:36:38.000Z","size":332,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-15T10:09:11.890Z","etag":null,"topics":["friendly-url","htaccess","php","smarty","smarty-template-engine","smarty-templates"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulo-correia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T23:31:29.000Z","updated_at":"2019-07-02T23:39:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7e98673-f9ab-4bbe-bae8-70eb38fff48b","html_url":"https://github.com/paulo-correia/Smarty_Help","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulo-correia/Smarty_Help","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulo-correia%2FSmarty_Help","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulo-correia%2FSmarty_Help/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulo-correia%2FSmarty_Help/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulo-correia%2FSmarty_Help/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulo-correia","download_url":"https://codeload.github.com/paulo-correia/Smarty_Help/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulo-correia%2FSmarty_Help/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260273416,"owners_count":22984491,"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":["friendly-url","htaccess","php","smarty","smarty-template-engine","smarty-templates"],"created_at":"2025-01-22T00:43:00.814Z","updated_at":"2025-06-17T01:38:46.357Z","avatar_url":"https://github.com/paulo-correia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Alt text](imgs/0.png)\n\n## Gerenciamento de Templates e URL amigáveis\n\nPré Requisitos:\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026bull; Apache (Qualquer versão) configurado para ler e interpretar o .htaccess\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026bull; PHP 5.2 ou superior\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026bull; Linux (Não testei no Windows)\n\nApós ter os pré requisitos, crie uma pasta para o seu protejo exemplo \"projeto_x\", estando dentro dela crie o arquivo .htaccess com o seguinte conteúdo:\n\n```\n\u003cIfModule mod_rewrite.c\u003e\nRewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ index.php?route=$1 [L,QSA]\n\u003c/IfModule\u003e\n```\n\nBaixe o Smarty pela url https://www.smarty.net/download após extrair deve existir uma pasta chamada \"smarty-3.1.33\"\n\nCrie uma pasta chamada \"templates_c\", esta terá permissões especiais, coloque as permissões como 777.\n\nCrie uma pasta chamada \"templates\" e dentro desta crie uma pasta chamada \"default\", estas pastas não requerem nenhuma permissão especial\n\nNa \"raiz\" do seu \"projeto_x\" crie o arquivo index.php com o seguinte conteúdo:\n\n```\n\u003c?php\n\nrequire_once \"smarty-3.1.33/libs/Smarty.class.php\";\n$smarty = new Smarty();\n$smarty-\u003etemplate_dir = \"templates/default\";\n$smarty-\u003ecompile_dir = \"templates_c\";\n\n$array['nome'] = \"Paulo\";\n$array['email'] = \"nome@dominio.com.br\";\n\n$params = $_GET;\n\n$smarty-\u003eassign(\"array\", $array);\n$smarty-\u003eassign(\"params\", $params);\n\n$smarty-\u003edisplay('index.tpl');\n```\n\nNa pasta \"templates/default\" crie o arquivo index.tpl com o seguinte conteúdo:\n\n```\n\u003chtml\u003e\n\u003chead\u003e\n\u003ctitle\u003eSmarty\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\nNome: {$array['nome']}\n\u003cbr\u003e\nE-mail: {$array.email}\n\u003cbr\u003e\nGET: {$params.route}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nO Smarty é bem simples de usar, bem documentado (em inglês, veja na url https://www.smarty.net/documentation), pense em usar ele no seu próximo projeto :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulo-correia%2Fsmarty_help","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulo-correia%2Fsmarty_help","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulo-correia%2Fsmarty_help/lists"}