Skip to content

Taco Class The power of jQuery all wrapped up in a Codeigniter Library

World Wide Web Server edited this page Jul 4, 2012 · 10 revisions

[color=green][size=4][b]The Taco class for codeigniter.[/b] [/size][/color] [color=green]——————————————————————————————————————————————————-[/color] You can see a demonstration of this libaray at http://findmeonthe.net/TACONITE/ It has lots of examples and the source code is dowloadable. [color=green]——————————————————————————————————————————————————-[/color] [size=3][color=blue]Updated to version:- 4.05[/color][/size]

What does this class do:

  • [b]Manipulate html elements from within your controller [/b]
  • [b]Transmit data via AJAX[/b]
  • [b]Send JQUERY commands e.g. slideUp, fade, show, hide, replaceWith, append, etc etc. to munipulate your webpages, without reloading the pages[/b]

This class simply generates an xml file that allows you to take control of your webpage.

For this to work you need the [url=http://jquery.com]JQUERY [/url]library and the Taconite library from [url=http://malsup.com/jquery/taconite]malsup.com[/url] added to your [VIEW] file.

[b]The power behind this library is the Taconite Plugin for JQUERY which is well documented on the [url=http://malsup.com/jquery/taconite]MALSUP[/url] website.[/b]

This example shows how you can easily manipulate the structure of the DOM. The markup is as follows.

[color=red][size=3]In the view file[/size][/color]

[code]

This is the structure example div.
[/code] The following code is used in the view to request example1: [code] $('#MYBUTTON').click(function() {$.get('http://findmeonthe.net/TACONITE/index.php/taco_example/example1'); }); [/code]

[color=red][size=3]In the controller the php code[/size][/color] [code] function example1() { $this->taco->set('after', '#example1', 'This text will go AFTER the example div.'); $this->taco->set('before', '#example1', '

This div will go BEFORE the example div.
'); $this->taco->set('wrap', '#example1 span', ''); $this->taco->set('append', '#example1', '
This div is APPENDED
'); $this->taco->output();
} [/code]

[color=red][size=3]The browser ouput is[/size][/color] [code]

This div will go BEFORE the example div.
This is the structure example div.
This div is APPENDED
This text will go AFTER the example div. [/code]
Clone this wiki locally