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.
class TacoController extends Controller
* 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.
<?php echo CHtml::form();
echo CHtml::ajaxLink('Do Taco',array('taco'),array('type'=>'POST'));
<?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'); ?>
Thank you for your order!<br/>
Your order has shipped!
This is a replace taconite function! Hence it won't append.
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 .