Yii Playground: collaborative demo app.

The top nav has what would appear to be other areas of the website, but clicking produces nothing in Chrome.

Examples are: General, Extensions

Hello,

that are just empty placeholders for now ;)

If someone wants to provide some content for that topics (especially extensions) is welcome :)

bye,

Giovanni.

I wonder, what we can demo in security

any suggestion?

And about general. What will it be the example? I just haven’t got any idea yet~

Hello,

secure file uploads is a big one :P

CSRF (Cross-site Request Forgery) is another nice topic…

In the meantime I’ve commited the ExtensionModule with a demo of the JNotify extension, a jQuery plugin I’ve just provided a Yii Extension for. I hope you’ll find it useful ;)

bye,

Giovanni.

p.s.

I can’t reach the live demo right now (yiiplayground.cubedwater.com) but I guess it will be back soon ;)

Okay then, maybe I’ll learn CSRF…

currently I am a little busy, so haven’t add anything yet…

Hope can update the playground soon~ :D

Giovanni, currently I am try to create example for preventing CSRF by enabling enableCsrfValidation

but I don’t know how to show the code from /config/development.php (the code need configuration in config)

Must I put it at other place?

Thanks before

Oh ya, I’ve changed a little components/DBManage.php

I append isset to the $_GET[‘r’] because sometimes it may be empty which will cause php throw notice.

It won’t cause error, but for server like WAMP or other with it’s error reporting (E_ALL or E_NOTICE) this will

causing fatal error in Yii…

Hello,

sorry for the delay in my answer, heve been busy :P

Anyway you can use the getSnippetFromFile method of SrcCollect… You can see an example in protected/modules/UiModule/views/ui_other/breadcrumbs.php ;)

You’re right, thanks for fixing it :)

bye,

Giovanni.

Hello Giovanni…

thanks… but after thinking a while, I won’t put CSRF demo first.

The CSRF Demo is related to changing application’s configuration, which will effect all the demos of the applications. I am afraid by enabling csrf validation might causing other demos not working. So for sometimes being I am not thinking to use this way first (I will try to another way to validate csrf without touching configuration file). Because just now I made CStarRating-with-ajax demo (with CSRF validation activated), and the ajax didn’t work because of the validation problem…

Oh yes and by the way, I’ve added CStarRating! :D

Hello,

I don’t know if this could be related to a framework bug or what, but sounds a bit strange to me… I think it would be better to manageto activate CSRF globally from config cause this would be the most “real” scenario… ::) And other examples shouldn’t break I guess. Maybe we could open a new topic to ask about this…

Great! It’s available on the live demo now:

http://www.yiiplayground.cubedwater.com/index.php?r=UiModule/web/starRating

Btw… I were thinking of moving the "star rating" menu item under the "other" menu, do you think it is a good idea / is it ok for you?

bye,

Giovanni.

Hi guys,

Sorry for inactivity with playing on playground project :)

Does somebody can suggest an idea for some extension which can be added to playground?

I would like to add extension for elrte text editor.

http://elrte.org/

Think I need to check then, what’s wrong with the code.

No problem :)

I think elRTE is cool…:)

Giovanni,

Oh yeah, forgotten to ask :P

Do you think I should also move the Star Rating directory to the ui_others ??

Currently it is still in a new directory called "web"

Giovanni,

I’ve decided it’s better to put the CStarRate code in Ui_otherController too…

it has been committed. Tell me if you don’t think this is a good way.

Btw, new demo, CTreeView :)

I think that this is fine; sorry for the delay of my answer. Anyway I were a bit undecided too but for now I think it is ok in this way; any suggestion is welcome.

Nice, I’ve updated the live demo… that now is based on Yii 1.1.5 :)

http://www.yiiplayground.cubedwater.com/index.php?r=UiModule/ui_other/treeView

I’ve also added a new small demo to show how to use the inline calendar:

http://www.yiiplayground.cubedwater.com/index.php?r=UiModule/jui/ziiDatePicker#inlineCalendar

And I’m working on a “complete” crud demo that uses gridview + jui dialog to edit fields ;)

bye,

Giovanni.

Giovanni, I begin to wonder how to put new examples in the Interface menu. When one should put the code into the "Other" sub-menu, when should put into the main menu. Currently from what I observe it seems like CJuiXXX is always put on the main Interface menu. I think we must begin to give a clear classification, so to minimize as little as possible the "Other".

After a long vacuum, at last I’ve added new simple example, CMenu :P

Hope can post some examples regularly…

Hi,

I agree but I don’t know how we could organize it; my subdivision was between primary and secondary interface items… having the secondary in the “other” menu ::)

Oh, also… a small note: could you please use tabs instead of spaces to indent? This works better with the syntax highlight plugin. You should be able to set this setting as a per-project preference.

And thanks for the CMenu example, I’ve updated the live demo!

bye,

Giovanni.

Sure no problem. I’ve fix the CMenu example to tab instead spaces…

Hello all,

At last I’ve successfully activating CSRF in YiiPlayGround without any major problem. Few months ago, I’ve tried to enabling it but then it made CStarRating ajax post become unrunnable, so I disabled it back.

As long as we stick the way of Yii in creating form (using CHtml::beginForm()) then it will run like usual. The problem is because of the CSRF activated, every form will have a token which will validated on the controller. Since my CStarRating using POST when running Ajax (without putting token) it cannot be run. Now I got the solution by putting it manual in my parameter like this :


$this->widget('CStarRating',array(

    'name'=>'ratingAjax',

    'callback'=>'

        function(){

                $.ajax({

                    type: "POST",

                    url: "'.Yii::app()->createUrl('UiModule/ui_other/starRatingAjax').'",

                    data: "'.Yii::app()->request->csrfTokenName.'='.Yii::app()->request->getCsrfToken().'&rate=" + $(this).val(),

                    success: function(msg){

                                $("#result").html(msg);

                        }})}'

  ));

Hope this is the right approach…