Skip to content

add empty cell in dynamic twig table

Hi I’ve got the following array And I need to convert it into a table using twig, this is what i’ve achieved so far But i need to achieve this instead: This is my code so far: As you can see from the pictures I need to add an empty cell if the dynamic key in the array doesn’t exist,

Accumulate monthly totals while looping

I have an array of data containing monthly amounts from the current year and the previous year. The previous year always has all of its amounts, but when a current/future month in the current year is iterated it has a null value. Here is an example: This is my current code How can I roll previous month amount…

Add HTML table data to $_post

I wanted to add a Dictionary to PHP $_POST, Dictionary will be containing the data of the html table such that the columns heading are the keys and values(of respective key) are the list containing the table data(row wise) of their respective column. HTML example I wanted to add this data to a dict(internal S…

Assign value PHP variable as column name during fetching

I am trying to fetch the values from columns in a MySQL table using PHP. The variable $batch_id is dynamic, i.e. it changes column name depending on the request. Say, it can adopt value like ‘Batch1’ or ‘Batch10’. I was able to extract the column name into the $batch_id variable, but w…

How to submit 3 different forms with just one button in PHP

I am creating a multi-step form and need to ”upload”/save some information into a database. It consists of 3 forms. The problem is that only the last form is sending the information and that’s also where the submit button is. Code sample below: As I said, only the last form is sending the da…

Laravel 7 internal server error 500 when sending email

I’m having some trouble with sending email using laravel. I’ve looked around the stackoverflow for solutions but none worked so far. Here’s my env and code so far. and this is my mail.php file Now this is my code. It’s just a simple to test the email function. This is the class created…

docker entrypoint sh file restarting

I am testing docker with my php project. Everything is ok in testing but if I add ENTRYPOINT, docker is restarting. Here is my docker compose file Dockerfile start-container.sh file I also print log for that docker image. I think my error is docker container is restarting after running start-container.sh file…