Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/vendor/yiisoft/yii2/widgets/ |
Upload File : |
<?php /** * @link https://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license https://www.yiiframework.com/license/ */ namespace yii\widgets; use yii\base\Widget; /** * Spaceless widget removes whitespace characters between HTML tags. Whitespaces within HTML tags * or in a plain text are always left untouched. * * Usage example: * * ```php * <body> * <?php Spaceless::begin(); ?> * <div class="nav-bar"> * <!-- tags --> * </div> * <div class="content"> * <!-- tags --> * </div> * <?php Spaceless::end(); ?> * </body> * ``` * * This example will generate the following HTML: * * ```html * <body> * <div class="nav-bar"><!-- tags --></div><div class="content"><!-- tags --></div></body> * ``` * * This method is not designed for content compression (you should use `gzip` output compression to * achieve it). Main intention is to strip out extra whitespace characters between HTML tags in order * to avoid browser rendering quirks in some circumstances (e.g. newlines between inline-block elements). * * Note, never use this method with `pre` or `textarea` tags. It's not that trivial to deal with such tags * as it may seem at first sight. For this case you should consider using * [HTML Tidy Project](https://www.html-tidy.org/) instead. * * @see https://www.html-tidy.org/ * @author resurtm <resurtm@gmail.com> * @since 2.0 */ class Spaceless extends Widget { /** * Starts capturing an output to be cleaned from whitespace characters between HTML tags. */ public function init() { parent::init(); ob_start(); ob_implicit_flush(false); } /** * Marks the end of content to be cleaned from whitespace characters between HTML tags. * Stops capturing an output and echoes cleaned result. */ public function run() { echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); } }