And the answer to your issue has already been posted..
the
$request
and <input>
names have to be the same. Your request name: t
Your input name: topic_id
$request
and <input>
names have to be the same. <form>
located here: viewtopic_panel_post_body_inner.html#L22-L61<form action="pontuacao">
is a hard coded string, you will have to change this to: {{ path('red1000_pontuacao_formulariopontuacao') }}
.vale=""
, so even if you request them, you will get no value from them.viewtopic.php
, you can simply use {{ TOPIC_ID }}
to get the id of the current topic.<input type="hidden" name="topic_id" value="{{ TOPIC_ID }}">
name=""
of the variable you are trying to request, is t
. As you can see, neither of your hidden input fields have the name="t"
.$topic_id = $this->request->variable('topic_id', 0);
, as <input name="topic_id">
does exist, and now also has the value of the actual topic id.<form action="{{ path('red1000_pontuacao_formulariopontuacao', {'some_variable': 16}) }}" ..
$some_variable = $this->request->variable('some_variable', 0); // Result: 16
I do not even know where to start.mrgoldy wrote: ↑Sat Dec 22, 2018 11:43 am Lets bite the hand that feeds you.
Just quoting me to make sure I get a notification, is what I call needy, that's why I asked you to stop quoting me.
And I know people are not born all-knowing, that's why I am trying to help you, but you will not take it.
So, I am going to try this one last time to make it clear:
You have a<form>
located here: viewtopic_panel_post_body_inner.html#L22-L61
And you have a controller that should handle the submission of that form: controller.
Your<form action="pontuacao">
is a hard coded string, you will have to change this to:{{ path('red1000_pontuacao_formulariopontuacao') }}
.
Then you have two hidden input fields.
Hidden iput 1: id
Hidden input 2: topic_id
Both have NO value assign, see thevale=""
, so even if you request them, you will get no value from them.
Seeing that template event is within theviewtopic.php
, you can simply use{{ TOPIC_ID }}
to get the id of the current topic.
So that would make it:
<input type="hidden" name="topic_id" value="{{ TOPIC_ID }}">
Then in your controller, you try to request a variable here.
Thename=""
of the variable you are trying to request, ist
. As you can see, neither of your hidden input fields have thename="t"
.
So you will have to change that to$topic_id = $this->request->variable('topic_id', 0);
, as<input name="topic_id">
does exist, and now also has the value of the actual topic id.
Alternatively, you can also define those parameters in your action url, so that would look like this:
<form action="{{ path('red1000_pontuacao_formulariopontuacao', {'some_variable': 16}) }}" ..
$some_variable = $this->request->variable('some_variable', 0); // Result: 16
Code: Select all
SQL
SQL ERROR [ mysqli ]
Table '.PHPBB_PONTUACAO_ENEM' doesn't exist [1146]
SQL
SELECT COUNT(*) AS number_of_rows , avg(comp1) as comp1 , avg(comp2) as comp2 , avg(comp3) as comp3 , avg(comp4) as comp4 , avg(comp5) as comp5 FROM PHPBB_PONTUACAO_ENEM WHERE topic_id = 5476
BACKTRACE
Code: Select all
$sql = 'SELECT *
FROM ' . 'PHPBBKK_PONTUACAO_ENEM' . '
WHERE user_id = ' . $this->user->data['user_id'] . '
AND topic_id = ' . (int) $topic_id;
parameters.yml
and import that into your services.yml
.mrgoldy wrote: ↑Sat Dec 22, 2018 2:12 pm Look at the Skeleton extension.
You have to add a table through migrations.
Then declare that table in yourparameters.yml
and import that into yourservices.yml
.
Then in the file you need it, for instance your controller, inject it as a dependency.
phpBB's Board Rules example:
- Migrations
- Tables.yml
- import in services
- inject as a service
- construct it
- use it