Facebook
RSS

Membuat Template dengan CodeIgniter Bagian 1

-
Pramadya Puspa

Kali ini saya belajar mengatur template dengan framework CodeIgniter.
Untuk bagian pertama ini, saya belajar bagaimana menyusun template dengan Controller dan View pada CodeIgniter. Sekilas sebagai pelengkap dokumentasi ini, pemahaman sederhana saya tentang Controller adalah suatu class dalam konsep OOP. Sedangkan View adalah sebagai sarana untuk menampilkan perintah-perintah dan nilai dari Controller situs judi bola

Saya mencoba merancang template secara umum, yakni memiliki header, topmenu, content, dan footer.

*Klik pada gambar untuk memperjelas





















Dalam menyusun template di CodeIgniter, antara elemen satu dengan yang lain dipisahkan. Maksudnya antara Header, Menu, dll tidak berada pada file yang sama. Oleh karena itu kita harus membuat elemen-elemen tersebut.

Berikut ini adalah pohon directory saya. Saya menggunakan CI 1.7.2.






















Oleh karena itu BASE URL pada system/application/config/config.base_url, saya ubah sebagai berikut:






Sehingga jika saya ketikkan pada browser, http://localhost/Mytemplates/index.php, akan muncul welcome_message dari CodeIgniter. Ini adalah tampilan dari class Welcome pada controller default-welcome.













Berikutnya adalah membuat masing-masing elemen. Saya simpan pada folder –layout-pada root directory tadi.
1.) header.php








2.) topmenu.php








3.) content.php









4.) footer.php








Kita siapkan Controller untuk menampikan elemen-elemen tersebut, C:\xampp\htdocs\MyTemplates\system\application\controllers\Home.php

Home.php ini akan menampilkan template.php pada view, yang menampung header.php, topmenu.php, dll. Sebenarnya dapat juga kita dapat menampilkan elemen-elemen ini dari Home.php. Tapi saya gunakan template.php untuk latihan berikutnya dan agar file lebih rapi.

Home.php












Sedangkan template.php ditempatkan pada Views. à C:\xampp\htdocs\MyTemplates\system\application\views\layout\template.php.








Berikutnya debugging.

http://localhost/Mytemplates/index.php/home








Kesimpulan:
Pemakaian framework pada penyusunan layout/template adalah agar programmer lebih mudah dalam proses modifikasi pada tiap elemen. Kerangka dari apa yang kita tulis sebelumnya secara mudah dapat digambar sbb:

98 Responses so far.

  1. Ijin sedot tutornya..

  2. Anonim says:

    ternyata membuat template pakai ini cukup mudah ya sobat? Raras ingin belajar juga ah, biar nanti bisa lebih kreatif dan inovatif, biar lebih keren dan beda daripada yang lain :-)

  3. Anonim says:

    ternyata membuat template pakai ini cukup mudah ya sobat? Raras ingin belajar juga ah, biar nanti bisa lebih kreatif dan inovatif, biar lebih keren dan beda daripada yang lain :-)

  4. buat tutorial ngawur >.<

  5. Adib Jr says:

    agar ketika di klik about muncul profil di content itu gimana caranya?

  6. Makasih Info bagus menarik bermanfaat, moga sukses selalu
    Vimax Canada
    Vimax Canada Asli

  7. sarana penangkal santet dengan doa, mantra dan ilmu anti santet, agar terhindar dari dukun santet
    santet
    santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet |

  8. sarana penangkal santet dengan doa, mantra dan ilmu anti santet, agar terhindar dari dukun santet
    santet
    santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet | santet
    santet | santet | santet | santet | santet | santet | santet | santet | santet

  9. Ucif says:

    Bagus informasi ini sangat di butuhkan

  10. thank you for the article you gave and very useful. always success.....

    Judi Bola
    Agen Judi
    Agen Bola
    Judi Online
    Bola Online
    Agen Judi Online

  11. Idola Qq says:
    Komentar ini telah dihapus oleh pengarang.
  12. SITUS88POKER.NET Menjadi salah satu situs judi poker online terpercaya di Indonesia

    Situs Poker Online
    Situs Poker
    Poker Online
    Situs Judi Online
    Judi Online

  13. KAKIQQ Situs Judi Poker DominoQQ BandarQ Sakong Online Terpercaya di Indonesia

    Situs Poker Online
    Situs Poker
    Poker Online
    Situs Judi Online
    Judi Online

  14. SITUSPOKERONLINETERPOPULER.COM Memberikan banyak sekali review mengenai Situs Judi Poker Online Terpercaya di Indonesia Situs Poker Online Terpopuler
    Situs Poker Online
    Poker Online
    Situs Judi Online
    Judi Online

  15. This article is interesting, hopefully useful for all of us, and don't forget to visit our website
    Judi Online
    Togel Online
    Slot Online
    Casino Online
    Judi Bola

  16. Jual obat aborsi 100% manjur. Informasi lebih lanjut Hub 082244058007 atau kunjungi klinik-aborsiaman.com


    Jual Obat Aborsi

    Jual Obat Aborsi pontianak

    Jual Obat Aborsi bandar lampung

  17. I got this web site from my buddy who informed me about this website and at the moment this time I am visiting this web
    page and reading very informative content at this place.

    link alternatif sbobet
    tangkasnet
    link sbobet
    icetuna
    sbobet88
    www.sbobet.com
    sbobet.com
    betfortuna
    harybox
    richuse
    sbobet casino
    338sbobet.com

  18. admin says:

    http://engineersatwar.imeche.org/home-front/images/default-source/homefront/munitions/making-the-napier-aero-engine-in-1915

    Zammora is an Online Store that was established in 2017, providing fashion products for women. We are focused on the beauty of design, and we are obsessed with quality

    tas wanita

    Search engine optimization (SEO) or Indonesian SEO is the process of influencing the visibility of websites or web pages in search engine results - often referred to as "natural", "organic" or "earned" results. In general, the earlier (or rank higher on search results pages), and more often sites appear in the list of search results, the more visitors will receive from search engine users, and these visitors can be converted to customers.

    SEO can target various types of searches, including image search, local search, video search, academic search, news search and industry-specific vertical search engines.

    Indonesian SEO

    Specialist SEO.com is an Indonesian SEO Service launched in 2011 when search engines were in the early stages of developing their algorithms, Google was a big company that was very promising. Search engine optimization (SEO) has a completely different meaning. Since then many things have changed and internet marketing has become a necessity for every company that wants to survive in the online world competitively.

    Specialist SEO Indonesia SEO Services deal with Web Marketing technology from the start. After hours of research and development, trial and error, we can now offer the most reliable solutions in the world of Digital Marketing.

    Indonesian SEO Service

    You can chat, video call, phone, view photos, have fun, and even meet!
    online datingsite, online dating indonesia, free online dating, best online dating site free, online dating app, online dating terbaik, dating online chat, situs online dating, free dating sites without payment, dating online with video call, dating, meet me, meet, people nearby, soulmate, heart, online dating apps, free online dating, video call, audio chat, find your partner, setipe, skout, flurv, bigo live, Tinder, OkCupid, Hookup, BeeTalk
    online dating site

  19. admin says:

    dompetpoker.online is a card game that shares betting rules and is usually (but not always) in hand ranking. The Poker Online game is different in terms of how cards are shared. In the most modern Poker Games, the first round of betting starts with several forms. Type of card arrangement in Online Poker.

    poker online

    Choosing an online casino agent is essential if people want to work on online gambling. http://www.dompetcasino.club/ to make the play scene should really be done so that the smoothness in playing gambling can be enjoyed gambling agency sites online casino agency page can also be done with a system of observing recommendations and recommendations from more experienced players.
    judi online

  20. admin says:

    Welcome to asetqq.vip, the Best and Most Trusted Indonesian Online Poker Site. AsQQQ provides 6 games that can be played in 1 User Id only. Online Poker, DominoQQ, Bandar Ceme, Capsa Susun, Live Poker, Ceme Keliling Games, using Indonesian real money
    poker online

    jdk88.id/ is the jadwal bola, first trusted online betting agent in Indonesia that provides live baccarat, roulette and sicbo online services. Giving customer satisfaction and serving better than others.
    Always determined to be able to serve customers better. Trying to remain a Soccer Agent, Casino Agent, the best and most trusted Online Betting in Indonesia
    Jadwal bola

    Onekartu is a trusted online poker agent Site. Original Money Poker uses IDNPlay servers that are 100% proven trusted and fairplay. Deposit and Withdraw Process in Crotqq start from 10 thousand rupiah and with fast and safe process. Customer Service Crotqq is available 24 hours to help you if you are having problems. onekartu.net is always trying to become a trusted online poker agent for those of you who want a Fairplay Poker game.

    poker uang asli

    AGWbet is an online gambling agent that is an online casino agent, online casino, online casino, online casino, online casino, online casino, and more. AGWbet has collaborated with several Indonesian local banks such as BCA, BRI, BNI and independently to improve services in the deposit and withdrawal process.

    agen bola terpercaya

  21. greece says:

    http://warezinternational.com/

  22. greece says:

    [url=http://yourkidsandsports.com/]88 poker[/url]

Leave a Reply