Welcome Guest, Not a member yet? Register   Sign In
Template Library Version 1.4.1
#31

[eluser]Référencement Google[/eluser]
Thanks Colin for the answer, yeah namespacing is a good argument, I'll start using CI_Somelib too for some libs. Keep us the good work !
#32

[eluser]Colin Williams[/eluser]
@Milos: http://ellislab.com/forums/viewreply/473148/
#33

[eluser]Milos Dakic[/eluser]
[quote author="Colin Williams" date="1226330176"]@Milos: http://ellislab.com/forums/viewreply/473148/[/quote]

Does this allow me to use it like so: $this->template->write_view('content', 'page.tpl') if I'm in: /application/modules/products/.

Will it look in /application/modules/products/views?
#34

[eluser]Colin Williams[/eluser]
Unless you are suggesting Views in the 5th parameter and on, it is equivalent to doing $this->load->view('page.tpl');

So, it depends on how ME works.
#35

[eluser]Randy Casburn[/eluser]
[quote author="Colin Williams" date="1226309610"]@Randy: First off, thanks for the kind words. I think I see where you are going with add_region() but I don't know... I'm not thinking very logically tonight Smile The placement of regions is provided by the master_template, with receives the regions as variables, like a classic view. If you wanted the added region to output above $footer, you would simply shift it "above" footer in the template's markup. I have a feeling we are on different pages... Feel free to discuss it more.
[/quote]

Ding Dong...the lights just turned on. I think I understand why I've confused you. The order of presentation is not set by the render() it set based upon the order in which the write() method is called on each region. Is this accurate?

My (must be) wrong headedness on this was thinking that the render method was rendering the stack of regions based upon where they were in the array stack not based upon which order the write method was issued.

So the solution to placing content where (in the place within the HTML document) you want it dynamically is to simply call the write method in the correct order.

Do I have this right? If so, may I recommend a slight adjustment to the docs that specifically states this? Just for thick heads like me that can seem to see the obvious in front of our faces.

Thanks Colin,

Randy
#36

[eluser]AgentPhoenix[/eluser]
Ooh, 1.5/2.0? Anything super cool going in to those releases? Smile
#37

[eluser]Adnan_I[/eluser]
I'm completely new to ci, and from start I wanted to use some kind of "templating engine" to manage different regions of views. After doing a lot of research I found this library as most promissing one (mostly due to good documentation and maintenance).
But, after scanning through many posts and reading documentation I couldn't find any information whether template library shuould be manually loaded
Code:
$this->load->library('template');
or whether it should be instantiated some other way.
I tried autoloading, I tried copying template library to system/libraries.
Nothing helps.
Whatever I do I get Unable to load the requested class: template.

What could I be missing?

p.s. I load all other libraries without problems.
#38

[eluser]palZ[/eluser]
Hello Adnan Ibrišimbegovic,

It is working for me without any problem & i'm loving it, hope you also...
I'm using CI 1.7 & Template 1.4.1

Did you followed "Getting Started with Template" document from http://williamsconcepts.com/ci/codeignit...start.html.

To install:
1. /libraries/Template.php - Move to your system/application/libraries/ folder.
2. /config/template.php - Move to your system/application/config/ folder. We’ll review this file later.
3. /views/template.php - Move to your application system/application/views/ folder.

Now we are ready to use the Template:

1: go to config/template.php & add or edit regions.
Example:
Code:
$template['email']['regions'] = array(
   'header',
   'content',
   'sidebar',
   'footer',
);

2: In your controller:
Code:
$this->load->library('template');

$this->template->write('header', 'Your content');
$this->template->write('content', 'Your content');
$this->template->write('sidebar', 'Your sidebar');
$this->template->write('footer', 'Your footer');
$this->template->render();
that's all!!
#39

[eluser]Adnan_I[/eluser]
palZ thanks for reply.

I also use CI 1.7 and Template 1.4.1

I already did exactly everything as documentation instructs. After extracting I double-checked that all 3 files (library, config, template) are in place.
I followed all the steps from the Template manual, but it would always return me the same error.

I previously read whole CI manual, and I learned there that libraries should always be either auto-loaded or manually loaded into the controller. I never saw any instructions saying Template library should be loaded before use. How? Why?

Anyway, after reinstalling my CI (just in case) and trying again I managed to get to the template object only after manually loading the library ($this->load->library('template')Wink inside controller. And that's strange, because I tried this before, and failed, although my previous CI installation was as clean as new one.
#40

[eluser]Randy Casburn[/eluser]
Hey Colin -- Strange with the SVN of 1.7.0 I have duplicated this exact issue of not being able to autoload your library. This is a brand new issue. It had not had an affect in the past. I've not taken a deeper view, but when I auto load the config CI complains the config file is malformed. It isn't of-course, but this leads to deeper thoughts.

Bottom line - I'm not a CI noob and I can confirm the problem Adnan Ibrišimbegović reported as I discovered this just this morning as I started a new project.

Randy




Theme © iAndrew 2016 - Forum software by © MyBB