tutorials: article json
parent
48ea136a9a
commit
5971aa7fef
|
@ -342,7 +342,7 @@ pub fn (app mut App) new_article() {
|
||||||
title := app.vweb.form['title']
|
title := app.vweb.form['title']
|
||||||
text := app.vweb.form['text']
|
text := app.vweb.form['text']
|
||||||
if title == '' || text == '' {
|
if title == '' || text == '' {
|
||||||
app.vweb.text('Empty text/titile')
|
app.vweb.text('Empty text/title')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
article := Article{
|
article := Article{
|
||||||
|
@ -359,7 +359,10 @@ pub fn (app mut App) new_article() {
|
||||||
parameters via function arguments: `new_article(title, text string) {`.
|
parameters via function arguments: `new_article(title, text string) {`.
|
||||||
|
|
||||||
We need to update `index.html` to add a link to the "new article" page:
|
We need to update `index.html` to add a link to the "new article" page:
|
||||||
|
|
||||||
|
```html
|
||||||
<a href='/new'>New article</a>
|
<a href='/new'>New article</a>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
Loading…
Reference in New Issue