Skip to main content

14 posts tagged with "php"

View All Tags

Sticky scroll in vscode

· One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Sticky scroll in vscode

https://dev.to/amrsamy/vs-code-sticky-scroll-2jcd

vscode has recently added a really useful new feature: sticky scroll.

This function allows you to scroll through a document such as a Markdown file, a source code written in PHP or JavaScript or any other supported language and, as you scroll, block contextual information such as the name of the class, the name of the function, the start of the loop, etc. in the upper part of the editor.

Working with Laravel events

· 5 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Working with Laravel events

When I started developing for the Joomla CMS (that was 15 years ago, in 2009), one of the things I liked most was the notion of events.

For example An article is about to be posted, An article has been posted, A user has registered, ... i.e. actions that are announced by the CMS and to which you can react.

When An article is about to be displayed is generated, you can have one (or more) pieces of code interact with this event. You can add dynamic content, you can also deny the article to be displayed if certain conditions are not met.

The easiest way to run a PHP script / website

· One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

The easiest way to run a PHP script / website

The situation: you wish to run a piece of standard PHP code (no dependency) like the one below:

<?php

echo "<h2>Incorrect, silent bug</h2>";

print_r(json_decode(utf8_decode("Ipso lorem"), true));

echo "<h2>Incorrect, we got an exception</h2>";

print_r(json_decode(utf8_decode("Ipso lorem"), true, 512, JSON_THROW_ON_ERROR));