Anyone here using template engines instead of pure HTML?

Discussion Of All Legal Topics Is Fine Anything Goes. Be Respectful of Others. No Personal Information or Attacks.
All Traffic, Link, Banner, Push Notification and Advertising, Offers & Requests Here,.
Domains & Websites For Sale and Requests Here.
Keep One thread per person & No More Than 1 Weekly Bump.
moma
Verified Member
Verified Member
Posts: 87
Joined: July 13th, 2018, 12:14 pm

#16

Post by moma » October 25th, 2018, 10:11 am

I started out with css on my blog and like how it works




User avatar
AlexO
Verified Member
Verified Member
Posts: 6393
Joined: February 10th, 2018, 5:37 pm
Title: I like Celebrities

#17

Post by AlexO » October 26th, 2018, 11:10 am

html5 was all the rage a few years back
Give me celebrity porn :twisted:

Colmike7
Banned
Banned
Posts: 1670
Joined: May 23rd, 2018, 12:21 pm
Title: (>^-^)b

#18

Post by Colmike7 » October 26th, 2018, 11:24 am

sebflo wrote: ↑
October 23rd, 2018, 6:25 pm
Colmike7 wrote: ↑
October 23rd, 2018, 5:36 pm
sebflo wrote: ↑
October 23rd, 2018, 4:33 pm


Yea I use bootstrap quite a bit, I dont like to use pre-made bootstrap templates though as they are usually pretty messy.

I usually stay away from heavy development frameworks like Laravel or Zend.

Template engines have quite a few benefits. Still though I usually stick with HTML5 and SASS or CSS3.

However Template engines can complement HTML5 and CSS3.

For example take the following.

Twig Username output to div

Code: Select all

<div>
{% for user in users %}
    * {{ user.name }}
{% else %}
    No users have been found.
{% endfor %}
</div>
Compared to a core php version

Code: Select all

<div>
<?php if($users): ?>
    <?php foreach($users as $user): ?>
        <?= $user['name']; ?>
    <?php endforeach; ?>
<? else: ?>
    No users have been found.
<?php endif; ?>
</div>
Sure not the only way to get the result but look at how clean the twig version looks compared to the core php version.
That's pretty neat, I might look into Twig more. For a while I thought it was more of a macro kind of thing to make PHP seem easier, and why I never really paid attention to it, but it's more like separating the logic with the PHP and front end display code, which can make big projects and changes easier and quicker. Or to give a designer the front end part and not have to worry about getting lost in someone else's PHP.
I do like regular PHP a lot, though, so it might still be hard to persuade me to use something else lol.

I agree with the heavy frameworks, too. Sure, I can read a ton and learn another way to do the same thing with something a little fancier, but why would I want to if I don't need to for the same end result?
Yea twig is pretty sweet, definitely not needed but it does help separate php or similar from html.

Blade is a nice template engine too and is used a lot with laravel.

Yea frameworks like laravel or codeigniter are pretty heavy. I do use them but only when in large teams.

When working with teams I take the following approach.

Front End: Template Engine
Back-end: Laravel or Codeigniter
Database: Stored Procedures

I use this structure because when working on a large team you never know when some one is going to quit or not work out, because Laravel and codeignite have pretty strict rules as far as structures goes, its very easy to have another developer take over a task.

I use Stored procedures to separate database queries from in code queries, so as a database admin I have full control of the queries and can store them. When developers need to access data from a query they can just call a stores procedure.

For example

Code: Select all

$query = $database->prepare("SELECT * FROM table WHERE id = ?");
$query->execute(array($param));
$query = $query->fetchAll(PDO::FETCH_ASSOC);
return $query
Here is what the stored procedure would look like

Code: Select all

$query = $database->prepare("CALL: get_all(?)"); //Stored procedure is called
$query->execute(array($param));
$query = $query->fetchAll(PDO::FETCH_ASSOC);
return $query
Better yet you can turn the request into a lambda request and just have the lambda return json from the database.

I use this so the developers don't touch the database and just focus on logic.

The front-end guys can then simply access the data returned by the logic and simply output the results with a template engine.

When working alone I tend to do something similar but with less restrictions as it's just me doing front-end, backend, and database work.

Its not the only way to do things, just kinda the way I like to work when it comes to working with team members.
Could I ask what you do in the adult industry? You seem to know a bit more than most people that I run into.




sebflo
Verified Member
Verified Member
Posts: 138
Joined: October 9th, 2018, 1:16 pm

#19

Post by sebflo » October 26th, 2018, 12:09 pm

Colmike7 wrote: ↑
October 26th, 2018, 11:24 am
sebflo wrote: ↑
October 23rd, 2018, 6:25 pm
Colmike7 wrote: ↑
October 23rd, 2018, 5:36 pm


That's pretty neat, I might look into Twig more. For a while I thought it was more of a macro kind of thing to make PHP seem easier, and why I never really paid attention to it, but it's more like separating the logic with the PHP and front end display code, which can make big projects and changes easier and quicker. Or to give a designer the front end part and not have to worry about getting lost in someone else's PHP.
I do like regular PHP a lot, though, so it might still be hard to persuade me to use something else lol.

I agree with the heavy frameworks, too. Sure, I can read a ton and learn another way to do the same thing with something a little fancier, but why would I want to if I don't need to for the same end result?
Yea twig is pretty sweet, definitely not needed but it does help separate php or similar from html.

Blade is a nice template engine too and is used a lot with laravel.

Yea frameworks like laravel or codeigniter are pretty heavy. I do use them but only when in large teams.

When working with teams I take the following approach.

Front End: Template Engine
Back-end: Laravel or Codeigniter
Database: Stored Procedures

I use this structure because when working on a large team you never know when some one is going to quit or not work out, because Laravel and codeignite have pretty strict rules as far as structures goes, its very easy to have another developer take over a task.

I use Stored procedures to separate database queries from in code queries, so as a database admin I have full control of the queries and can store them. When developers need to access data from a query they can just call a stores procedure.

For example

Code: Select all

$query = $database->prepare("SELECT * FROM table WHERE id = ?");
$query->execute(array($param));
$query = $query->fetchAll(PDO::FETCH_ASSOC);
return $query
Here is what the stored procedure would look like

Code: Select all

$query = $database->prepare("CALL: get_all(?)"); //Stored procedure is called
$query->execute(array($param));
$query = $query->fetchAll(PDO::FETCH_ASSOC);
return $query
Better yet you can turn the request into a lambda request and just have the lambda return json from the database.

I use this so the developers don't touch the database and just focus on logic.

The front-end guys can then simply access the data returned by the logic and simply output the results with a template engine.

When working alone I tend to do something similar but with less restrictions as it's just me doing front-end, backend, and database work.

Its not the only way to do things, just kinda the way I like to work when it comes to working with team members.
Could I ask what you do in the adult industry? You seem to know a bit more than most people that I run into.
I do software engineering and data science for the adult industry. Everything from building heavy data driven software and deploying it within a secure, cost effective, and scalable environment, to heavy data science and analytics to tune business decisions.




User avatar
jag
Verified Member
Verified Member
Posts: 6527
Joined: February 15th, 2018, 9:51 am
Title: From Malta with love
Referrals: 1

#20

Post by jag » October 27th, 2018, 8:35 am

Code confuses me, I am a wysiwyg girl
From Malta with love and sunshine

User avatar
nudelinks
Verified Member
Verified Member
Posts: 1231
Joined: February 26th, 2018, 8:12 pm

#21

Post by nudelinks » October 29th, 2018, 10:03 am

shit you two colmike7 and sebflo know php , good for you guys.




sebflo
Verified Member
Verified Member
Posts: 138
Joined: October 9th, 2018, 1:16 pm

#22

Post by sebflo » October 29th, 2018, 2:21 pm

nudelinks wrote: ↑
October 29th, 2018, 10:03 am
shit you two colmike7 and sebflo know php , good for you guys.
Thanks




User avatar
cimage
Verified Member
Verified Member
Posts: 1592
Joined: June 3rd, 2018, 2:36 pm
Title: living the good life

#23

Post by cimage » October 31st, 2018, 10:03 am

sebflo wrote: ↑
October 18th, 2018, 3:20 pm
I generally use HTML and SCSS or CSS. However I have worked on a few projects that use Blade or Twig template engines. Gotta say Its very clean and easy to write, but its taken a bit of getting used to with my development workflow.

Anyone use a template engine for their projects? What are your thoughts?
You are a programmer type so it's easy for you to try this and other ideas, I just put in the mysql database name, user name and password and get on with it.
Stop looking for reps if they don't care why waste your time and traffic at their program, fuck that.
~ cimage 2024

User avatar
BHT
Verified Member
Verified Member
Posts: 1458
Joined: March 30th, 2018, 3:28 pm

#24

Post by BHT » November 1st, 2018, 10:18 am

cimage wrote: ↑
October 31st, 2018, 10:03 am

You are a programmer type so it's easy for you to try this and other ideas, I just put in the mysql database name, user name and password and get on with it.
Bingo!





What I wanted to post here.




ispdn
Verified Member
Verified Member
Posts: 1446
Joined: March 25th, 2018, 8:23 pm

#25

Post by ispdn » November 3rd, 2018, 2:33 pm

HTML is my preferred method.




Austin
Verified Member
Verified Member
Posts: 539
Joined: July 13th, 2018, 6:30 pm
Referrals: 1

#26

Post by Austin » November 18th, 2018, 2:07 pm

Trying to get a grasp of Wordpress for now, but do explain the choices.




Colmike7
Banned
Banned
Posts: 1670
Joined: May 23rd, 2018, 12:21 pm
Title: (>^-^)b

#27

Post by Colmike7 » November 18th, 2018, 3:19 pm

Austin wrote: ↑
November 18th, 2018, 2:07 pm
Trying to get a grasp of Wordpress for now, but do explain the choices.
Feel free to post any WP questions. I've been using it since 09-10 I think.




ZR1
Verified Member
Verified Member
Posts: 295
Joined: April 2nd, 2018, 8:33 am

#28

Post by ZR1 » November 22nd, 2018, 10:03 am

what is scss I know and use css.




User avatar
pussyhunter
Verified Member
Verified Member
Posts: 959
Joined: July 13th, 2018, 3:40 am

#29

Post by pussyhunter » November 29th, 2018, 10:10 am

xr1 wrote: ↑
November 22nd, 2018, 10:03 am
what is scss I know and use css.
sassy css




CTE
Verified Member
Verified Member
Posts: 611
Joined: March 13th, 2018, 3:31 pm

#30

Post by CTE » December 1st, 2018, 11:16 am

Any method to load my sites faster is a good one, if this is what it takes I'll try it out.




Anyone here using template engines instead of pure HTML?

Post Reply