{"id":132,"date":"2025-05-03T18:57:43","date_gmt":"2025-05-03T18:57:43","guid":{"rendered":"https:\/\/www.webmobkey.com\/blog\/?p=132"},"modified":"2025-11-16T10:22:30","modified_gmt":"2025-11-16T10:22:30","slug":"php-ile-layout-olusturma","status":"publish","type":"post","link":"https:\/\/www.webmobdesign.com\/blog\/tr\/php-ile-layout-olusturma\/","title":{"rendered":"PHP ile Layout Olu\u015fturma"},"content":{"rendered":"\n<p id=\"be59\">Web geli\u015ftirme s\u0131ras\u0131nda sayfalar\u0131n\u0131z\u0131n belirli b\u00f6l\u00fcmlerinin (\u00f6rne\u011fin ba\u015fl\u0131k, men\u00fc, altbilgi) tekrar tekrar kullan\u0131labilir olmas\u0131, projenizin y\u00f6netilebilirli\u011fini ve s\u00fcrd\u00fcr\u00fclebilirli\u011fini artt\u0131r\u0131r. PHP kullanarak layout olu\u015fturmak, bu amaca ula\u015fman\u0131za yard\u0131mc\u0131 olur. \u0130\u015fte ad\u0131m ad\u0131m bir rehber:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"aceb\">1. Layout Dosyalar\u0131n\u0131 Haz\u0131rlay\u0131n<\/h4>\n\n\n\n<p id=\"e8d0\">\u00d6ncelikle, layout dosyalar\u0131n\u0131z\u0131 olu\u015fturun. Genellikle,&nbsp;<code>head.php<\/code>,&nbsp;<code>header.php<\/code>&nbsp;ve&nbsp;<code>footer.php<\/code>&nbsp;gibi dosyalar olu\u015fturulur.<\/p>\n\n\n\n<p><code><strong>includes\/head.php<\/strong><\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;\/title&gt;\n    &lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot;&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n<\/pre><\/div>\n\n\n<p><strong>includes\/header.php<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;header&gt;\n    &lt;nav&gt;\n        &lt;ul&gt;\n            &lt;li&gt;&lt;a href=&quot;index.php&quot;&gt;Home&lt;\/a&gt;&lt;\/li&gt;\n            &lt;li&gt;&lt;a href=&quot;about.php&quot;&gt;About&lt;\/a&gt;&lt;\/li&gt;\n            &lt;li&gt;&lt;a href=&quot;contact.php&quot;&gt;Contact&lt;\/a&gt;&lt;\/li&gt;\n        &lt;\/ul&gt;\n    &lt;\/nav&gt;\n&lt;\/header&gt;\n<\/pre><\/div>\n\n\n<p><code><strong>includes\/footer.php<\/strong><\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;footer&gt;\n    &lt;p&gt;&amp;copy; 2024 My Website&lt;\/p&gt;\n&lt;\/footer&gt;\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"11b7\">2. Ana Sayfa Dosyas\u0131n\u0131 Haz\u0131rlay\u0131n<\/h4>\n\n\n\n<p id=\"0c49\">\u015eimdi, ana sayfa dosyan\u0131z\u0131 (<code>index.php<\/code>) olu\u015fturun ve bu dosyada layout dosyalar\u0131n\u0131z\u0131 dahil edin.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?php\n$title = 'Home Page';\nob_start(); ?&gt;\n\n&lt;p&gt;Welcome to my website. This is the home page content.&lt;\/p&gt;\n\n&lt;?php\n$content = ob_get_clean();\ninclude 'layout.php';\n?&gt;\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"1fec\">3. Layout Dosyas\u0131n\u0131 Olu\u015fturun<\/h4>\n\n\n\n<p id=\"8ed5\">Son olarak,&nbsp;<code>layout.php<\/code>&nbsp;dosyas\u0131n\u0131 olu\u015fturun ve t\u00fcm layout dosyalar\u0131n\u0131 bu dosyada bir araya getirin.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"5530\"><code>layout.php<\/code><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n    &lt;?php include 'includes\/head.php'; ?&gt;\n    &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;?php include 'includes\/header.php'; ?&gt;\n\n    &lt;main&gt;\n        &lt;?php echo $content; ?&gt;\n    &lt;\/main&gt;\n\n    &lt;?php include 'includes\/footer.php'; ?&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"8e43\">4. Sayfalar\u0131n\u0131z\u0131 Olu\u015fturun<\/h4>\n\n\n\n<p id=\"334b\">Art\u0131k yeni bir sayfa olu\u015fturmak istedi\u011finizde, ayn\u0131 yap\u0131y\u0131 kullanarak h\u0131zl\u0131ca yeni sayfalar olu\u015fturabilirsiniz. \u00d6rne\u011fin,&nbsp;<code>about.php<\/code>&nbsp;sayfas\u0131n\u0131 \u015fu \u015fekilde olu\u015fturabilirsiniz:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"fd09\"><code>about.php<\/code><\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;?php\n$title = 'About Us';\nob_start(); ?&gt;\n\n&amp;lt;p&gt;This is the about page content. Here you can learn more about us.&amp;lt;\/p&gt;\n\n&amp;lt;?php\n$content = ob_get_clean();\ninclude 'layout.php';\n?&gt;\n<\/pre><\/div>\n\n\n<p id=\"6744\">PHP ile layout olu\u015fturmak, web sayfan\u0131z\u0131n farkl\u0131 b\u00f6l\u00fcmlerini yeniden kullan\u0131labilir hale getirir ve kodunuzu daha mod\u00fcler ve y\u00f6netilebilir k\u0131lar. Bu y\u00f6ntemle, sayfa i\u00e7eri\u011finizi kolayca g\u00fcncelleyebilir ve d\u00fczenleyebilirsiniz. Web sitenizin bak\u0131m\u0131n\u0131 ve geni\u015fletilmesini bu \u015fekilde \u00e7ok daha verimli hale getirebilirsiniz.<\/p>\n\n\n\n<p id=\"6fe1\">Umar\u0131m bu rehber PHP ile layout olu\u015fturma konusunda size yard\u0131mc\u0131 olmu\u015ftur. E\u011fer herhangi bir sorunuz veya geri bildiriminiz varsa, yorumlar k\u0131sm\u0131nda payla\u015fabilirsiniz.<\/p>\n\n\n\n<p id=\"cffb\">Bu \u00f6rneklerle, PHP ile temel bir layout yap\u0131s\u0131 olu\u015fturmay\u0131 ve kullanmay\u0131 \u00f6\u011frenmi\u015f oldunuz. Layout dosyalar\u0131n\u0131 \u00f6zelle\u015ftirerek ve geni\u015fleterek, daha karma\u015f\u0131k ve fonksiyonel web sayfalar\u0131 olu\u015fturabilirsiniz.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web geli\u015ftirme s\u0131ras\u0131nda sayfalar\u0131n\u0131z\u0131n belirli b\u00f6l\u00fcmlerinin (\u00f6rne\u011fin ba\u015fl\u0131k, men\u00fc, altbilgi) tekrar tekrar kullan\u0131labilir olmas\u0131, projenizin y\u00f6netilebilirli\u011fini &hellip; <a title=\"PHP ile Layout Olu\u015fturma\" class=\"hm-read-more\" href=\"https:\/\/www.webmobdesign.com\/blog\/tr\/php-ile-layout-olusturma\/\"><span class=\"screen-reader-text\">PHP ile Layout Olu\u015fturma<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-web-tr"],"_links":{"self":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":1,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions\/329"}],"wp:attachment":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}