开发者

How to integrate yahoo user interface with cakePHP

Hi all I am very new to cakePHP, I want to add YUI accordion in the default layout of my application. A simple explanation could be like this -

  1. I have a table 'lecturers' in my database.
  2. I have baked the model lecturer (file)
  3. I have baked the controller lecturers_controller (file)
  4. I have baked the view lecturers (folder)
  5. I need to override the default layout but I want to add YUI 3 accordion sothat

the table name lecturers will be on top, after clicking on the top division it will slidedown and will show me the column name of lecturer table.

Is there anyone who could suggest me how to integrate the YUI 3 accordion - Do I have to write a helper for this or simply after copying the YUI 3 library I could code this in the default.ctp file.

I am really confused as I could hardly get a full tutorial on this topic.

Thank you in advance ................开发者_如何学编程


Not entirely sure this answers your question, but you should be able to just include YUI 3 on your page and use it. Something like this ought to do:

<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>

YUI({
    gallery: 'gallery-2010.04.08-12-35'
}).use('gallery-accordion', function(Y) {

    var accordion = new Y.Accordion(/* your configuration */);

    accordion.render();

});

That's it! If that's not working for whatever reason, post some code and I can help debug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜