diff --git a/include/layout.inc b/include/layout.inc index df947f4550..74ef7cf6ef 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -425,7 +425,7 @@ function site_header(string $title = 'Hypertext Preprocessor', array $config = [ global $MYSITE; $meta_image_path = $MYSITE . 'images/meta-image.png'; - $meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; + $meta_description = $config['description'] ?? "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; $defaults = [ "lang" => myphpnet_language(), diff --git a/styles/why-use-php.css b/styles/why-use-php.css new file mode 100644 index 0000000000..5b5d11cc1e --- /dev/null +++ b/styles/why-use-php.css @@ -0,0 +1,199 @@ +.block { + margin: 2rem auto 4.5rem; +} + +.block img { + max-width: 100%; + max-height: 100%; +} + + +.block p { + margin-bottom: 0.5rem; +} + +.block--grid { + display: grid; + grid-template-columns: 2fr 3fr; + grid-gap: 2rem; +} + +.title { + font-size: 2.5rem; + font-weight: 500; + margin-bottom: 1.5rem; + color: #000; + line-height: 1; +} + +.description { + color: #4b5563; +} + +.subtitle { + font-weight: 500; + margin-bottom: 0.5rem; +} + +.block__intro { + display: flex; + flex-direction: column; + justify-content: center; +} + +.hero__body { + font-size: 1rem; + line-height: 1.75rem; +} + +.hero ul { + list-style: none; + padding: 0; + margin: 1.25rem 0; +} + +.hero ul li { + position: relative; + padding: 0 0 0 2.25rem; +} + +.hero ul li:before { + position: absolute; + top: 2px; + left: 0; + content: url('data:image/svg+xml,'); + width: 20px; + height: 20px; + display: inline-block; +} + +.cta { + text-align: center; + font-size: 1.2rem; + line-height: 1.75rem; + max-width: 900px; + margin: 4rem auto 0; +} + +.logos { + display: grid; + grid-template-columns: repeat(8, 1fr); + grid-gap: 1rem; + margin: 2rem auto; +} + +.logo__item { + display: flex; + align-items: center; + justify-content: center; + height: 80px; + break-inside: avoid; + box-shadow: #dddddd 0 .125rem .5rem; + border-radius: .25rem; + background: #F9F9F9; + padding: 0.5rem; +} + +.logo__item img { + max-width: 100%; + max-height: 100%; +} + +.cards { + display: grid; + grid-gap: 1rem; + margin: 2rem auto; + grid-template-columns: 1fr; +} + +.cards--2 { + grid-template-columns: repeat(2, 1fr); +} + +.cards--3 { + grid-template-columns: repeat(3, 1fr); +} + +.card { + padding: 1.5rem; + break-inside: avoid; + box-shadow: #dddddd 0 .125rem .5rem; + border-radius: .25rem; + background: #F9F9F9; +} + +.card--columns { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-gap: 1rem; +} + +.card__title { + font-size: 1.5rem; + font-weight: 500; + margin-bottom: 1.5rem; +} + +.card__link { + margin-top: 0.5rem; + color: #4b5563; +} + +.card__image { + height: 40px; + margin-bottom: 1rem; +} + +.card__cover { + +} + +.phpcode { + background-color: #FFF; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); + border-radius: 0 0 2px 2px; + overflow-x: auto; + display: flex; + align-items: center; + width: 100%; + height: 100%; + padding: 50px 40px 38px; + box-sizing: border-box; + margin: 0; +} + +.phpcode code { + display: block; + overflow-x: auto; + white-space: pre-wrap; +} + +@media (max-width: 1280px) { + .logos { + grid-template-columns: repeat(6, 1fr); + } +} + +@media (max-width: 1024px) { + .logos { + grid-template-columns: repeat(4, 1fr); + } +} + +@media (max-width: 768px) { + .block { + margin: 2rem auto; + } + + .block--grid, + .cards, + .card--columns { + display: flex; + flex-direction: column; + gap: 1rem; + } + + .logos { + grid-template-columns: repeat(2, 1fr); + } +} diff --git a/why-use-php.php b/why-use-php.php new file mode 100644 index 0000000000..b37de3c1dd --- /dev/null +++ b/why-use-php.php @@ -0,0 +1,402 @@ + 'community', + 'description' => 'PHP is the ideal choice for web development. Learn about its speed, flexibility, and rich ecosystem. Explore PHP\'s capabilities in building websites, APIs, e-commerce platforms, and more. See why industry leaders trust PHP for their projects.', + 'css' => ['why-use-php.css'], +]); +?> + +
PHP is a general-purpose language that excels on the web.
+Here are some compelling reasons to choose PHP:
+PHP offers developers a robust and versatile platform for building dynamic and scalable web + applications, empowered by its intuitive syntax, extensive libraries, and vibrant community support. + Laravel and Symfony stand as premier choices for building web applications, offering developers + robust + frameworks equipped with modern features, elegant design patterns, and comprehensive documentation + to + streamline development and ensure scalability and maintainability.
+We should add a sentence, or even a full section about "frontend" tools like Laravel Livewire and + Symfony Turbo and their benefits (UX as good as with JS heavy frameworks, easier to develop and to + maintain, better cache dynamics...). These tools are a large part of what makes PHP relevant + again.
+I would also mention how these tools are part of the "no build" movement (Symfony AssetMapper + etc).
+PHP offers a powerful suite of data processing tools, enabling developers to manipulate and analyze + data efficiently with its extensive libraries and functions. Leveraging PHP's intuitive syntax and + seamless integration with databases, developers can tackle complex data processing tasks + effectively, empowering them to extract valuable insights and drive informed decision-making + processes.
+PHP excels in high-load environments and scales effortlessly:
+PHP stands as a reliable choice for developing APIs, offering a wealth of features and libraries such + as API Platform to streamline the process while ensuring + scalability and security. With its + extensive community support and seamless integration with databases and web servers, PHP empowers + developers to create robust APIs that facilitate smooth communication between applications and + enable efficient data exchange across platforms.
+PHP dominates the e-commerce space:
+PHP integrates well with AI and ML technologies:
+