Hi,
I have created now a plugin where I can manage my contents in the backend. But now I want to display them on the fronted. But I cant find how I can do this. I think I have read I can do that to write some code in the components file of the plugin but i cant find any documentation where i can understand what i have to do.
For now i have try to access my content whit a query in the template file. I do a basic query ti 6 (id 6 exisist). I copy the query form the documentation and like this:
$results = Db::select('select * from my_table_name where id = ?', [6]);
print_r($results);
The error i get is:
syntax error, unexpected '$results' (T_VARIABLE), expecting function (T_FUNCTION) /home/ww/themes/testheme/pages/post.htm line 30
I don't understand why i get this error.....
What i tought before i create the plugin was that there is a option to make it so that i can use in my template file something like {{ books.title }}. Is there somewhere a example or howto to create this ?
My question is simple i geuss. How can i access my contents form the db on the fronted, and use them in {{ books.title }} ?
Last updated