[Solved] Taconite Example?

I tried to get a simple taconite example going and failed. Is there anyone more experience that can post a simple controller/view pair that shows how it works? A simple hello world call should suffice.

I am grappling with sending xhttprequest and getting it to the page in the right text/xml format and how it would get processed by the taconite js.

Here’s the jQuery Taconite JS library.

I gave it a show and ended up with all sorts of weird stuff :).

Thank you.

I finally found how to do it. For anyone who’s interested here’s a mini-tutorial on it.

Step 1: Download the taconite jquery plugin and place it in the js directory.

Step 2: For testing purposes, created a new controller.


class TacoController extends Controller


	public $defaultAction='index';

	public $layout='main_1col';



	 * This is the default 'index' action that is invoked

	 * when an action is not explicitly requested by users.


	public function actionIndex()





	public function actionTaco()






Step 3: Create a new view, in this case an index.php.

<div id="result3">



<div id="result1">



<?php	echo CHtml::form();

		echo CHtml::ajaxLink('Do Taco',array('taco'),array('type'=>'POST'));

		echo '</form>';



<div id="result2">


<?php	$baseUrl = Yii::app()->baseUrl;

		$clientScript = Yii::app()->getClientScript();



This sets up an ajax link and 3 divs location for the updates.

Step 4: Create another view called utaco.php for the taconite instructions.

<?php header('Content-type: text/xml'); ?>


    <append select="#result1"> 

        Thank you for your order!<br/>


    <append select="#result2"> 

        Your order has shipped! 


    <replace select="#result3"> 

        This is a replace taconite function!  Hence it won't append.



That’s it.

I am a noobie at Yii so if anyone wants to rewrite parts of it or point out mistakes, I am happy to learn.

Looks great! Saved me some time as I was about to investigate taconite.

I’m sure you know, but the <form> is unnecessary.

If you like, you can do this:


But if you want to use Yii’s assets, and keep the .js outside the base path; say, when you use the file in multiple apps. You can do, say:

$taconite = Yii::app()->basePath .'/../js/jquery.taconite.js';

$jsfile = Yii::app()->getAssetManager()->publish($taconite);


Ahhh… Thank you for the tips. I was just getting started with js too :).