Backend\Modules\Users\Engine\Model::getCSVLineEndings PHP Method

getCSVLineEndings() public static method

Get the possible line endings for a CSV-file
public static getCSVLineEndings ( ) : array
return array
    public static function getCSVLineEndings()
    {
        return array('\\n' => '\\n', '\\r\\n' => '\\r\\n');
    }

Usage Example

Example #1
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('add');
     // get the groups
     $groups = BackendGroupsModel::getAll();
     // if there is only one group we can check it so the user isn't bothered with an error for not selecting one
     $checkedGroups = count($groups) == 1 ? $groups[0]['value'] : null;
     // create elements
     // profile
     $this->frm->addText('email', null, 255);
     $this->frm->addPassword('password', null, 75, 'inputText inputPassword passwordGenerator', 'inputTextError inputPasswordError passwordGenerator')->setAttributes(array('autocomplete' => 'off'));
     $this->frm->addPassword('confirm_password', null, 75)->setAttributes(array('autocomplete' => 'off'));
     $this->frm->addText('name', null, 255);
     $this->frm->addText('surname', null, 255);
     $this->frm->addText('nickname', null, 24);
     $this->frm->addImage('avatar');
     $this->frm->addDropdown('interface_language', BL::getInterfaceLanguages(), $this->get('fork.settings')->get('Core', 'default_interface_language'));
     $this->frm->addDropdown('date_format', BackendUsersModel::getDateFormats(), BackendAuthentication::getUser()->getSetting('date_format'));
     $this->frm->addDropdown('time_format', BackendUsersModel::getTimeFormats(), BackendAuthentication::getUser()->getSetting('time_format'));
     $this->frm->addDropdown('number_format', BackendUsersModel::getNumberFormats(), BackendAuthentication::getUser()->getSetting('number_format', 'dot_nothing'));
     $this->frm->addDropDown('csv_split_character', BackendUsersModel::getCSVSplitCharacters());
     $this->frm->addDropDown('csv_line_ending', BackendUsersModel::getCSVLineEndings());
     // permissions
     $this->frm->addCheckbox('active', true);
     $this->frm->addCheckbox('api_access', false);
     $this->frm->addMultiCheckbox('groups', $groups, $checkedGroups);
 }
All Usage Examples Of Backend\Modules\Users\Engine\Model::getCSVLineEndings