Go Lang mysql html comments - go

I would like to create a mysql form for comments and display them as well in html.
I am able to use the MySQL package to read out data in the terminal but am struggling to output on the html/template engine any pointers welcome.

If I understand your question correctly, you are looking for a way to create dynamic webpages that have user input. You are going to need to learn some HTML/CSS to make it look nice (Even if you do use templates you can find online).
In terms of generating the dynamic content, Golang provides a builtin templating library [http://golang.org/pkg/text/template/]. Or if you like, you can look into other templating languages like Mustache or Handlebars, which have libraries in Go if you want to go that route.
For collecting user input, you're going to want to create a form that POSTs the data to a particular endpoint of your server. In making your server, I would look into both Golang's net/http package, which is fully featured, or you could look into Gorilla, another Go library that has a lot of nice features for making more powerful webapps and such.
A couple resources for you to check out:
https://golang.org/doc/articles/wiki/
http://www.gorillatoolkit.org/
Hope this helps!

Thanks I have understanding to do this with php and html I'm just trying to translate over too go Lang for the submitting and rendering out from mysql. I will look at creating a simple go form using the template engine.

Related

how to use charts package in laravel?

I want to use a chart package to create a chart using real time data from my database. I tried a package.The link i am providing bellow.But i am not successful.Can anyone provide me a full tutorial about this ?
https://charts.erik.cat/getting_started.html#screenshots
If you want to use charts in your laravel app, I believe you will need to do this in blade view (frontend)
Here are very good JS chat libraries with good documentation
I am currently using
https://www.chartjs.org/
Another good one
http://morrisjs.github.io/morris.js/
Chart solely for laravel http://lavacharts.com
Check these examples on adminlte
https://adminlte.io/themes/AdminLTE/pages/charts/chartjs.html
Another thing, you will need to learn how to use their API. This is universal, everyone has to learn. However, there are a lot of examples you could extract and use as a baseline.
Hope This helped you.

Joomla : Want to build custom form with my own back hand code

I just want to create custom html with good css form with my own php as backhand code and javascript for validation.. Is there any extension for this?
I have seen few extensions but none of them allows me to add my own php backhand code.
Thanks
If you are not going to use Joomla's framework, then you may as well build the form outside of joomla and insert it into the article via an iframe (you may need to change the editor's permissions to allow you to do this).
It is worth looking into using the framework properly, however, as it does have easy-to-use mail classes and actually makes things easier when you get your head around it.
(Though to answer your actual question - this module appears to allow you to add raw php http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules/3668 )

RESTful API with CMS Made Simple

I have a client with a content-heavy site built in CMS Made Simple. The redesign requires a mostly AJAX interface, and I think a frontend framework like Backbone or Angular would be the way to go.
I want to avoid moving off CMS Made Simple, though (client is used to that interface, it will be annoying to migrate all the data).
I think if I could find or create a RESTful api for CMS Made Simple, I'd solve my problem. But after searching around online, I only found CGSocialApp module, which seems to provide a limited API for things like user management. I've also looked into other AJAX solutions for CMS Made Simple, and there don't seem to be good modules for it.
If there is no ready-made solution for me, how complex would building a RESTful API module be? I haven't built a RESTFUL api in a PHP framework before.
Thanks for any guidance!
So, there is no easy answer for this question, as the CMSMS doesn't have a build-in RESTful API.
I would go for one of the two solutions:
1. Output the content as hand made json.
In CMSMS, you really have a lot of control on the templates. You could change the default templates to output json content instead of HTML content. The only issue is that the CMSMS will still send an http content-type header, that you can try to ignore in the JS part.
To access the menu, just remove it from the main template and create an empty page who output the {menu}with a custom template that also build json content.
That's the quick and dirty solution, but it should be very accessible in terms of doing it.
2. Create a dedicated module.
As far as I know, there are no modules that expose the CMSMS in RESTFul format, but a module is really very easy to build. Well, you can try to build it yourself, with the help of the community. It don't really solve the current problem, but it's a hint.
I hope it shed some light on the problem.

How do I use data stored in a Blob as a view?

We're currently doing a project that accepts user-provided html and has our own injected into it. This perfectly matches Play's abilities. However, I am at a loss as to how to use dynamic content as a view template without manual intervention. It seemed best to use a blob to store the information (given that there could be thousands of templates) and somehow load that way.
Any suggestions?
Thanks in advance.
If you really want to do this (I’m not convinced this is a good idea), have a look at the implementation of play.mvc.Controller.renderTemplate(String, Map<String,Object>) in the Play source, to see code that loads a template, binds variables and renders the template.

Getting started with Phil Sturgeon's CodeIgniter Template library

I'm trying to use Phil Sturgeon's CodeIgniter Template library, but I can't get it to change my pages. I read the documentation, followed the steps there,
Download
Copy to application folder
Create a views/layouts/default view
(Auto)load the library
however, it is not clear as to how the template is actually implemented. I thought that loading the view would apply the template everywhere, but it doesn't seem to work that way. I've also read about it in the CodeIgniter Wiki, but it looked too complicated to be the right answer.
How are you supposed to use Phil Sturgeon's Template with your controllers? (or views?) Am I missing something here?
It does not overload the load->view() methods, that would be bad. You need to update your controllers to use the template's syntax and methods in every instance you want to use it:
http://philsturgeon.co.uk/demos/codeigniter-template/user_guide/
You will use $this->template->build() instead of $this->load->view() in most cases, after constructing your template by defining regions, setting titles, etc.
There should have been a user guide included in your download with examples.

Resources