https://github.com/binjuhor/php-to-html
From PHP to HTML
https://github.com/binjuhor/php-to-html
bash html php scss
Last synced: about 2 months ago
JSON representation
From PHP to HTML
- Host: GitHub
- URL: https://github.com/binjuhor/php-to-html
- Owner: binjuhor
- License: gpl-3.0
- Created: 2021-06-16T00:55:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T01:29:40.000Z (over 2 years ago)
- Last Synced: 2025-11-09T14:41:31.557Z (8 months ago)
- Topics: bash, html, php, scss
- Language: SCSS
- Homepage:
- Size: 207 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Template PHP and HTML CSS JS project
This is an HTML project, based in PHP for including the files for quick publish the HTML files
## Install
+ Run `yarn` to install dependency
+ Run `yarn watch` to watch SCSS files changed
+ Run `yarn compressed` to compress the CSS file
+ Run `yarn build` to build HTML files in `./build/export-html`
## Files & Folders
- `assets` contain SCSS, CSS, Images, JS files
- `includes` contain included PHP functions file
- `templates-parts` contain part of PHP files you can call the PHP files in this folder by `template_parts` function with an
array variable params.
- `build.sh` to generate HTML files in `./build` folder
- `package.json`
## Development
Just clone and do whatever you want with `PHP` and `SCSS` files.\
For example, I have a template named `templates/list-post.php` so in `index.php` file we can call the template and passing data look like this.
```PHP
template_part('list-post', [
'data' => [
[
'title' => 'post 1',
'description' => 'Description 1'
],
[
'title' => 'post 2',
'description' => 'Description 2'
],
[
'title' => 'post 3',
'description' => 'Description 3'
]
]
]);
```
In template file `templates-parts/list-post.php` can use
```PHP
if (isset($data)) {
foreach ($data as $datum) {
echo $datum['title'];
echo $datum['description'];
}
}
```
Change the styles please use `*.scss` in folder `./assets/scss`
### Contact developer
---
Email: `kiemhd@outlook.com`
Team: xdevlabs.com