sailorproject / sailor

A Lua MVC Web Framework.
MIT License
921 stars 125 forks source link

Suggestion: Add a debug variable in the object Page #116

Open xspager opened 8 years ago

xspager commented 8 years ago

Might be useful to have a debug variable on the object Page so the template could decide to include or not a block of script like Google Analytic for example.

Etiene commented 8 years ago

you mean something like page:inspect? https://github.com/sailorproject/sailor/blob/master/docs/manual_page_object.md#pageinspect-var-

xspager commented 8 years ago

No, just value true or false I can use on a template to decide to include or not on the html the google analytics script.

Etiene commented 8 years ago

I see, you could add it at conf/confmaybe. We already have a debug.inspect field. As it's we only use it for inspect, maybe we should replace this for a simpler thing? Remove inspect and have debug only?

Then at the views you can local debug = require"conf.conf".debug

xspager commented 8 years ago

Would this be accessible on the view?

Etiene commented 8 years ago

Yes

2016-04-20 17:53 GMT+02:00 Daniel Lemos notifications@github.com:

Would this be accessible on the view?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/sailorproject/sailor/issues/116#issuecomment-212487247

Etiene Dalcol

Software Engineering student at ENSTA Bretagne and PUC-Rio Sailor Developer http://sailorproject.org Lua Ladies Founder http://lualadies.org

xspager commented 8 years ago

Oh, sorry, let me try again... Yes, conf.lua is the right place to this value. debug.inspect is very useful this would be something extra.