mirror of
https://github.com/restoreddev/phpapprentice.git
synced 2025-08-23 06:43:07 +02:00
Initial commit for public repo
This commit is contained in:
3
assets/templates/_footer.phtml
Normal file
3
assets/templates/_footer.phtml
Normal file
@@ -0,0 +1,3 @@
|
||||
</body>
|
||||
|
||||
</html>
|
15
assets/templates/_header.phtml
Normal file
15
assets/templates/_header.phtml
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title><?= $title ?? 'PHP Apprentice' ?></title>
|
||||
<meta name="description" content="<?= $description ?? 'A site for learning how to use PHP'?>">
|
||||
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
<link rel="icon" href="/favicon-32.png">
|
||||
<script src="/js/site.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
17
assets/templates/_table_of_contents.phtml
Normal file
17
assets/templates/_table_of_contents.phtml
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="table-of-contents">
|
||||
<h4>Table of Contents</h4>
|
||||
<a href="<?= page_path('index') ?>">Preface</a>
|
||||
<ol>
|
||||
<li><a href="<?= page_path('basics') ?>">Basics</a></li>
|
||||
<li><a href="<?= page_path('variables') ?>">Variables</a></li>
|
||||
<li><a href="<?= page_path('arithmetic') ?>">Arithmetic</a></li>
|
||||
<li><a href="<?= page_path('comparisons') ?>">Comparisons</a></li>
|
||||
<li><a href="<?= page_path('boolean-logic') ?>">Boolean Logic</a></li>
|
||||
<li><a href="<?= page_path('conditionals') ?>">Conditionals</a></li>
|
||||
<li><a href="<?= page_path('loops') ?>">Loops</a></li>
|
||||
<li><a href="<?= page_path('arrays') ?>">Arrays</a></li>
|
||||
<li><a href="<?= page_path('functions') ?>">Functions</a></li>
|
||||
<li><a href="<?= page_path('classes') ?>">Classes</a></li>
|
||||
</ol>
|
||||
<a href="<?= page_path('credits') ?>">Credits</a>
|
||||
</div>
|
19
assets/templates/credits.phtml
Normal file
19
assets/templates/credits.phtml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php partial('header', ['title' => 'PHP Apprentice - Credits']) ?>
|
||||
|
||||
<div class="container center">
|
||||
<div class="grid-toc">
|
||||
<div>
|
||||
<h1>Credits</h1>
|
||||
<p>
|
||||
PHP Apprentice was inspired by
|
||||
<a href="https://gobyexample.com/">Go By Example</a> and by <a href="https://elixirschool.com/">Elixir School</a>. Both sites offer excellent, quality documentation in Go and Elixir and I want PHP Apprentice to provide the same
|
||||
experience for the PHP programming language.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<?php partial('table_of_contents') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php partial('footer') ?>
|
41
assets/templates/default.phtml
Normal file
41
assets/templates/default.phtml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php partial('header', ['title' => $title, 'description' => $description]) ?>
|
||||
|
||||
<div class="menu">
|
||||
<button class="menu-button" title="Open Menu">
|
||||
<div class="icon"><?= icon('menu') ?></div>
|
||||
Menu
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container center">
|
||||
<h1><?= escape($title) ?></h1>
|
||||
<h3 class="subtitle"><?= escape($subtitle) ?></h3>
|
||||
<?= code_table($code) ?>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="navigate-links">
|
||||
<?php if (!empty($previous)): ?>
|
||||
<a href="<?= page_path($previous) ?>" title="Previous">
|
||||
<div class="icon"><?= icon('cheveron-outline-left') ?></div>
|
||||
Previous
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if (!empty($next)): ?>
|
||||
<a href="<?= page_path($next) ?>" title="Next">
|
||||
Next
|
||||
<div class="icon"><?= icon('cheveron-outline-right') ?></div>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal closed">
|
||||
<div class="modal-content">
|
||||
<button class="modal-button right" title="Close">
|
||||
<div class="icon"><?= icon('close-outline') ?></div>
|
||||
</button>
|
||||
<?php partial('table_of_contents') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php partial('footer') ?>
|
36
assets/templates/index.phtml
Normal file
36
assets/templates/index.phtml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php partial('header', ['title' => 'PHP Apprentice']) ?>
|
||||
|
||||
<div class="container center">
|
||||
<div class="grid-toc">
|
||||
<div>
|
||||
<div class="home-title-wrapper">
|
||||
<div class="home-logo"><?= icon('elephant') ?></div>
|
||||
<h1 class="home-title">PHP Apprentice <em>(beta)</em></h1>
|
||||
<h3 class="home-subtitle">A site for learning how to use PHP</h3>
|
||||
</div>
|
||||
<p>
|
||||
The goal of PHP Apprentice is to be an easy to understand resource for learning how to write good code in the PHP programming language. There are a lot of PHP tutorials on the internet that use outdated libraries, insecure programming practices or inefficient code. I want this site to show how to write PHP code with quality.
|
||||
</p>
|
||||
<p>
|
||||
The site currently has content for learning the basics of PHP. In the future, more pages will be added for more advanced topics like building websites, database integration and security.
|
||||
</p>
|
||||
<p>
|
||||
PHP Apprentice is currently a work in progress (hence "beta" is included in the title). If you would like to contribute or request a certain discussion topic, checkout the <a href="https://github.com/restoreddev/php-apprentice" target="_blank">GitHub repository</a>.
|
||||
</p>
|
||||
<p>
|
||||
To get started, you will need to install PHP 7.1, have a text editor and open your terminal.
|
||||
Each example in PHP Apprentice can by typed into a PHP file and executed in the terminal.
|
||||
Let's get started! 😃
|
||||
</p>
|
||||
<a href="<?= page_path('basics') ?>" class="button">
|
||||
<div class="icon"><?= icon('book-reference') ?></div>
|
||||
Open First Chapter
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<?php partial('table_of_contents') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php partial('footer') ?>
|
Reference in New Issue
Block a user