Welcome Guest, Not a member yet? Register   Sign In
No direct output from $this->renderSection
#1

(This post was last modified: 06-13-2024, 09:29 AM by minsk832.)

In the help itself, <?= is used already. Nevertheless, the function renderSection outputs the content directly via echo. It would be helpful if the value was only returned or if it could at least be controlled via a parameter.

This would have the advantage that, for example, if a page title is not set, you could maintain a standard for example with ?: parameter.

Code:
<title><?= $this->renderSection('title') ?></title>


Code:
<title><?= $this->renderSection('title') ?: 'Fallback title' ?></title>
Reply
#2

I sent PR https://github.com/codeigniter4/CodeIgniter4/pull/8965
Reply
#3

The PR has been merged. So this bug will be fixed in v4.6.0.
Reply
#4

(This post was last modified: 06-24-2024, 11:45 AM by minsk832.)

Thank you very much for the implementation and consideration! You are great! :-)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB