Anyone here using template engines instead of pure HTML?
-
moma
- Verified Member

- Posts: 87
- Joined: July 13th, 2018, 12:14 pm
I started out with css on my blog and like how it works
- AlexO
- Verified Member

- Posts: 6393
- Joined: February 10th, 2018, 5:37 pm
- Title: I like Celebrities
html5 was all the rage a few years back
Give me celebrity porn 
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
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 wrote: ↑October 23rd, 2018, 6:25 pmYea twig is pretty sweet, definitely not needed but it does help separate php or similar from html.Colmike7 wrote: ↑October 23rd, 2018, 5:36 pmThat'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.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
Compared to a core php versionCode: Select all
<div> {% for user in users %} * {{ user.name }} {% else %} No users have been found. {% endfor %} </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.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>
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?
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 exampleHere is what the stored procedure would look likeCode: Select all
$query = $database->prepare("SELECT * FROM table WHERE id = ?"); $query->execute(array($param)); $query = $query->fetchAll(PDO::FETCH_ASSOC); return $queryBetter yet you can turn the request into a lambda request and just have the lambda return json from the database.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
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.
-
sebflo
- Verified Member

- Posts: 138
- Joined: October 9th, 2018, 1:16 pm
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.Colmike7 wrote: ↑October 26th, 2018, 11:24 amCould I ask what you do in the adult industry? You seem to know a bit more than most people that I run into.sebflo wrote: ↑October 23rd, 2018, 6:25 pmYea twig is pretty sweet, definitely not needed but it does help separate php or similar from html.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?
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 exampleHere is what the stored procedure would look likeCode: Select all
$query = $database->prepare("SELECT * FROM table WHERE id = ?"); $query->execute(array($param)); $query = $query->fetchAll(PDO::FETCH_ASSOC); return $queryBetter yet you can turn the request into a lambda request and just have the lambda return json from the database.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
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.
- jag
- Verified Member

- Posts: 6527
- Joined: February 15th, 2018, 9:51 am
- Title: From Malta with love
- Referrals: 1
Code confuses me, I am a wysiwyg girl
From Malta with love and sunshine
- nudelinks
- Verified Member

- Posts: 1231
- Joined: February 26th, 2018, 8:12 pm
shit you two colmike7 and sebflo know php , good for you guys.
-
sebflo
- Verified Member

- Posts: 138
- Joined: October 9th, 2018, 1:16 pm
Thanks
- cimage
- Verified Member

- Posts: 1592
- Joined: June 3rd, 2018, 2:36 pm
- Title: living the good life
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.sebflo wrote: ↑October 18th, 2018, 3:20 pmI 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?
Stop looking for reps if they don't care why waste your time and traffic at their program, fuck that.
~ cimage 2024
~ cimage 2024
- BHT
- Verified Member

- Posts: 1458
- Joined: March 30th, 2018, 3:28 pm
Bingo!
What I wanted to post here.
-
ispdn
- Verified Member

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

- Posts: 539
- Joined: July 13th, 2018, 6:30 pm
- Referrals: 1
Trying to get a grasp of Wordpress for now, but do explain the choices.
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
Feel free to post any WP questions. I've been using it since 09-10 I think.
-
ZR1
- Verified Member

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

- Posts: 959
- Joined: July 13th, 2018, 3:40 am
-
CTE
- Verified Member

- Posts: 611
- Joined: March 13th, 2018, 3:31 pm
Any method to load my sites faster is a good one, if this is what it takes I'll try it out.