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 .
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.
<?php
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()
{
$this->render('index');
}
public function actionTaco()
{
if(Yii::app()->request->isAjaxRequest)
$this->renderpartial('utaco');
}
}
Step 3: Create a new view, in this case an index.php.
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'); ?>
<taconite>
<append select="#result1">
Thank you for your order!<br/>
</append>
<append select="#result2">
Your order has shipped!
</append>
<replace select="#result3">
This is a replace taconite function! Hence it won't append.
</replace>
</taconite>
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.