View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
10498Bug reportsErgonomypublic2026-11-20 15:21
ReporterDenisChenu Assigned To 
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Summary10498: A view must filter, not a controller
Description

A view know where information is put, and know if it need some character, encode or not filter script or not etc .....
The controller don't know that

Additional Information

echo CHtml::dropDownList('listname', $select,
array('M' => gt('Male'), 'F' => gt('Female')),
array('empty' => gT('Select a gender')));

Is really more clear than
< select >
< option value="" <? php (empty($select) ? '"selected"':''; ?>><?php echo gT('Select a gender') ?></option>

etc ....

What did you prefer :
https://github.com/LimeSurvey/LimeSurvey/blob/b39e2eed672f17865a2e1582f06e92e608132518/application/views/admin/notifications/notifications.php
or
https://github.com/LimeSurvey/LimeSurvey/blob/f267e0472040485f7e7633f8b7033eedd043bd02/application/views/admin/notifications/notifications.php

views is not a template engine.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

sammousa

sammousa

2016-02-18 10:32

reporter   ~35384

I prefer the first.
While I do get the argument for wanting to use pure HTML, I think we should try to abstract that away in subviews / widgets.
Even when using pure HTML there is no need for the repetition shown in the 2nd example.

Also I feel program flow becomes hard to read when jumping in and out of PHP mode each time.

c_schmitz

c_schmitz

2026-11-20 15:21

administrator   ~87823

The example view now uses a widget, and escaping in views is already the usual practice. Nothing concrete is left to change here, so I am closing this.

Issue History

Date Modified Username Field Change
2016-02-17 08:38 DenisChenu New Issue
2016-02-18 10:32 sammousa Note Added: 35384
2026-11-19 22:50 c_schmitz Status new => acknowledged
2026-11-19 22:50 c_schmitz Product Version 2.50.x =>
2026-11-20 15:21 c_schmitz Note Added: 87823
2026-11-20 15:21 c_schmitz Bug heat 2 => 4
2026-11-20 15:21 c_schmitz Status acknowledged => closed
2026-11-20 15:21 c_schmitz Resolution open => @0@
2026-11-20 15:21 c_schmitz Resolution @0@ => no change required