Welcome Guest, Not a member yet? Register   Sign In
Codeigniter most simple template
#1

[eluser]vile[/eluser]
Hi,

im using http://maestric.com/doc/php/codeigniter_template library.

I have a simple problem. I have multiple sections and i want to load a specific view file in each section..

example template:

View:
Code:
<div id='header'> &lt;?= $header; ?&gt;&lt;!-- i want to load view/header.php here --&gt; </div>
<div id='menu'> &lt;?= $menu; ?&gt;&lt;!-- i want to load view/menu.php here --&gt; </div>
<div id='footer'> &lt;?= $footer ?&gt;&lt;!-- i want to load view/footer.php here --&gt; </div>

Controller:
Code:
??

Thanks
#2

[eluser]umefarooq[/eluser]
hi checkout this template library will help you to solve your problem if you have any problem just post here

http://philsturgeon.co.uk/code/codeigniter-template

it is using partials which will help you to load view files
#3

[eluser]vile[/eluser]
ok thanks i will check it.
#4

[eluser]vile[/eluser]
[quote author="umefarooq" date="1279018733"]hi checkout this template library will help you to solve your problem if you have any problem just post here

http://philsturgeon.co.uk/code/codeigniter-template

it is using partials which will help you to load view files[/quote]


i dont get it. how do i use this? can you please make an example. thank you
#5

[eluser]vile[/eluser]
not workingggggggg Sad
#6

[eluser]umefarooq[/eluser]
hi its really simple you have to create a layout put in view folder if not using themes to manage and set the layout in you controller and calling views with template build check example attached files
#7

[eluser]vile[/eluser]
can you please tell me what does "view_name" and layout file do. im confused, it just displays black page. Sad
#8

[eluser]KingSkippus[/eluser]
With all due respect, I really think you need to read the CodeIgniter manual, maybe even some basic php tutorials, first. From your posts, it sounds like you do not have a firm grasp of some of the very basics of generating web pages. I don't want to discourage you from learning, but it really sounds kind of like you are picking up a calculus book, jumping halfway in, and then asking others to help you with stuff that is explained in Chapter 1.

I would hold off on using the template software referenced above. In fact, I would hold off on using CodeIgniter at all to begin with. Study php and make some basic web pages and sites using it until you are comfortable with how the programming language works. Once you have done that, download and install a base installation of CodeIgniter and work through the examples in the manual, and maybe do some basic tutorials like the video you linked to in your other post. Don't just watch them, do them, and expand on them to make your own basic sites. Then as you become more proficient with that, expand into some of the helpers, templates, etc. that you need to accomplish specific things.

Then, if you have any specific questions, come back here and post them. Post the particular bit of code you are having trouble with, the exact result you are getting ("not workingggggg" doesn't cut it), and what you were expecting.

Be patient when trying to learn something new. We want you to be an awesome CodeIgniter developer, but if we write your sites for you, you'll never come up to speed enough to write them on your own. Put in at least some time and effort in learning how the individual building blocks are put together before going out and trying your hand at a whole building.




Theme © iAndrew 2016 - Forum software by © MyBB