In the previous post we talked about how to include static resources in the Pharo image to be server with our application.
Let’s start with a new web application and, as we have seen in the relative post, we must create a class deriving from
ILApplication, write the
path method and an empty
ILApplication subclass: #LcBlogProjectNotes instanceVariableNames: '' classVariableNames: '' category: 'LeonardoBlog'
"LcApplication class>>path protocol accessing" path ^ 'ProjectNotes'
"LcApplication>>index protocol controllers" index ^ [ :e | e h1 text:'Hi!' ]
Remember to put the
index method in the protocol
Now we must integrate all the bootstrap code from the static resources generated in the previous post in the page.
Do to that we must override the
updatePage: method from
ILApplication like this:
updatePage: method get called when the page has been constructed and before its contents are sent to the browser. In this method you can customize the generated page as you want.
Voila’! We have integrated Bootstrap JS.