Search found 716 matches

by kasimi
Fri Dec 15, 2017 4:17 pm
Forum: Extensions in Development
Topic: [3.1][3.2][RC] Twig Converter
Replies: 48
Views: 2684

Re: [3.1][3.2][RC] Twig Converter

The messenger class uses template tags that go in the /language/en/email folder, so extensions that do emailing like mine must create them in our extensions. In 3.0 it was not as sophisticated as the full templating system. You could not use loops, for example. Perhaps this is no longer the case. I...
by kasimi
Fri Dec 15, 2017 9:15 am
Forum: Extension Writers Discussion
Topic: [Tutorial] Convert to Twig Syntax
Replies: 39
Views: 4353

Re: [Tutorial] Convert to Twig Syntax

MarkDHamill wrote:
Fri Dec 15, 2017 12:52 am
I have some language files with the old syntax still embedded in it.
There's template syntax embedded in language files? Do you have an example?
by kasimi
Tue Dec 12, 2017 6:00 pm
Forum: Extension Writers Discussion
Topic: [Tutorial] Convert to Twig Syntax
Replies: 39
Views: 4353

Re: [Tutorial] Convert to Twig Syntax

See first post, Includes section, first example. Also have a look at the Twig Converter extension.
by kasimi
Sat Dec 09, 2017 5:39 pm
Forum: Extension Requests
Topic: Highlight and "Marked as Read" Posts
Replies: 19
Views: 592

Re: Highlight and "Marked as Read" Posts

Your second request sounds like a thanks/like/thumbs-up extension with "thanks" changed to "has read" in the the language files.
by kasimi
Fri Dec 08, 2017 10:31 pm
Forum: Extension Writers Discussion
Topic: Updates in EPV
Replies: 29
Views: 1847

Re: Updates in EPV

This seems to be a bug in composer: https://github.com/composer/composer/issues/6859

A temporary solution is to downgrade to 1.5.2: https://github.com/kasimi/mChat/commit/ ... 139a46e592
by kasimi
Fri Dec 08, 2017 9:42 pm
Forum: phpBB Custom Coding
Topic: assign_block_vars and assign_block_vars_array
Replies: 3
Views: 85

Re: assign_block_vars and assign_block_vars_array

In your second code block, the 'block2' keys are ignored. Instead, try this: $template->assign_block_vars_array('block1.block2', [ ['a1', 'b1', 'c1'], ['a2', 'b2', 'c2'], ]); The above is the same as this: $template->assign_block_vars('block1.block2', ['a1', 'b1', 'c1']); $template->assign_block_var...
by kasimi
Thu Dec 07, 2017 6:04 pm
Forum: phpBB Custom Coding
Topic: Ways to include breadcrumb in own page
Replies: 7
Views: 193

Re: Ways to include breadcrumb in own page

Probably like this:

Code: Select all

$this->template->assign_block_vars_array('navlinks', [
    [
        'FORUM_NAME'   => 'CategoryB',
        'U_VIEW_FORUM' => 'URL to CategoryB',
    ],
    [
        'FORUM_NAME'   => 'SubcategoryB',
        'U_VIEW_FORUM' => 'URL to SubcategoryB',
    ],
]);
by kasimi
Sun Dec 03, 2017 9:49 pm
Forum: phpBB Custom Coding
Topic: assign_block_vars with multiple arrays
Replies: 2
Views: 144

Re: assign_block_vars with multiple arrays

Are you looking for assign_block_vars_array()?
by kasimi
Thu Nov 30, 2017 7:14 pm
Forum: Extension Writers Discussion
Topic: Get Template Variables
Replies: 1
Views: 143

Re: Get Template Variables

For phpBB 3.1.x and 3.2.0 you need to use the @template_context service:

Code: Select all

$username = $this->template_context->get_root_ref()['USERNAME'];
Since phpBB 3.2.1 you can use the @template:

Code: Select all

$username = $this->template->retrieve_var('USERNAME')
by kasimi
Wed Nov 29, 2017 12:33 pm
Forum: Extension Writers Discussion
Topic: Fill template in code
Replies: 6
Views: 272

Re: Fill template in code

Twig can do this easily for you: $template = 'This is my {{ TEMPLATE }}. I want to fill in all {{ DATA }}.'; $twig = new \Twig_Environment(new \Twig_Loader_Array(['template' => $template])); echo $twig->render('template', [ 'TEMPLATE' => 'awesome template', 'DATA' => 'my data', ]); // This is my awe...
by kasimi
Wed Nov 29, 2017 12:08 pm
Forum: Extension Writers Discussion
Topic: 3.2 Text Parser/Renderer tutorial
Replies: 20
Views: 639

Re: 3.2 Text Parser/Renderer tutorial

The $request->variable() method applies htmlspecialchars to the data. Before rendering, do the reverse:

Code: Select all

$post_text1 = htmlspecialchars_decode($post_text1, ENT_COMPAT);
by kasimi
Thu Nov 16, 2017 10:33 am
Forum: Extension Writers Discussion
Topic: Queries amount, sessions, empty response
Replies: 7
Views: 326

Re: Queries amount, sessions, empty response

Adding this empty JsonResponse solves everything. Is this allowed? Yes, it is indeed required. it still baffels me that when you forget a single "," at the end of a line in a language file the entire page turns white This is not limited to language files. You need to set up your development environ...

Go to advanced search