Php with layout type

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Object representation of a display layout, based upon CSS basic functionnality

makinacorpus/php-layout

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Object representation of a display layout, based upon CSS basic functionnality:

  • all items are always stacked vertically in containers;
  • a container can be a column set, case in which each column contains itself another container which will stack items vertically.

Once you understood this basic principle, you can use the API.

Leaf items (non container) are represented by an interface, with very few methods to implement, and a handler service, whose basic features are:

You probably understood it now, this was tailored for rendering speed on more complex frameworks that are already able to provide support for preloading and pre-rendering objects (for example, Drupal).

Please note this is, as of today, rather a playground than an API you could use, but it worth the short of trying.

You should be aware the goal of this API is to, in a near future, be integrated into page composition tools, and its API to be hidden behind user friendly UI for contributing. Don’t be afraid of the concrete code example below, it only shows how it works, but won’t be revelant for concrete use cases of this API.

For the sake of simplicity, we are going to use the unit test example to explain the layout we want to display, here is an HTML reprensentation of what the bootstrap grid we want:

div class pl-s">container"> div class pl-s">row"> div class pl-s">col-md-12" data-id pl-s">container:vbox/top-level"> div class pl-s">row" data-id pl-s">container:hbox/C1"> div class pl-s">col-md-6" data-id pl-s">container:vbox/C11"> item id pl-s">leaf:a/1" /> item id pl-s">leaf:a/4" /> div> div class pl-s">col-md-6" data-id pl-s">container:vbox/C12"> div class pl-s">row" data-id pl-s">container:hbox/C2"> div class pl-s">col-md-6" data-id pl-s">container:vbox/C21"> item id pl-s">leaf:a/2" /> item id pl-s">leaf:a/5" /> div> div class pl-s">col-md-6" data-id pl-s">container:vbox/C22"> item id pl-s">leaf:a/3" /> div> div> div> div> item id pl-s">leaf:a/6" /> item id pl-s">leaf:a/7" /> div> div> div>

Which, for the sake of comprehensibility, would display as such (yes I am sorry this is basic copy/paste of the comment lying in the unit test):

 /** * TOP LEVEL * +-----------------------------+ * | 2 columns, with nested: | * | C1 | * | C11 C12 | * | +-----------+-------------+ | * | | | C2 | | * | | | C21 C22 | | * | | | +----+----+ | | * | | A1 | | A2 | A3 | | | * | | A4 | | A5 | | | | * | | | +----+----+ | | * | +-----+-----+-------------+ | * | A6 | * | A7 | * +-----------------------------+ * * C: Container * A: Item of type A */ 

And the associated PHP code for creating the container tree:

// Create types $aType = new ItemAType(); // Place a top level container and build layout (no items) $topLevel = new TopLevelContainer('top-level'); $c1 = new HorizontalContainer('C1'); $topLevel->append($c1); $c11 = $c1->appendColumn('C11'); $c12 = $c1->appendColumn('C12'); $c2 = new HorizontalContainer('C2'); $c12->append($c2); $c21 = $c2->appendColumn('C21'); $c22 = $c2->appendColumn('C22'); // Now place all items $a1 = $aType->create(1); $a2 = $aType->create(2); $a3 = $aType->create(3); $a4 = $aType->create(4); $a5 = $aType->create(5); $a6 = $aType->create(6); $a7 = $aType->create(7); $c11->append($a1); $c11->append($a4); $c21->append($a2); $c21->append($a5); $c22->append($a3); $topLevel->append($a6); $topLevel->append($a7);

Before initializing the type handlers, we will first create the containers type handlers: containers are the basis of the grid and are responsible for the vertical and horizontal layout management.

// This is the class you would change in order to integrate more deeply with // your own theme and templating engine, or if you do not use bootstrap but // another grid layout. $gridRenderer = new BootstrapGridRenderer();

Now that we have our top-level container, we need to instanciate the various type handlers:

$itemTypeRegistry = new ItemTypeRegistry(); $itemTypeRegistry->registerType($aType);
$renderer = new Renderer($itemTypeRegistry, $gridRenderer); $string = $renderer->render($topLevel);

Which should give you for the $string the HTML representation we did show before.

Why should it render fast?

When you ask for rendering, two very important things are done:

  • the whole container tree is recursively traversed, and all leaf items are referenced in a flat index;
  • for each item type, all items are preloaded then rendered in one call.

Because containers do not represent anything related to the database or any business object either, you don’t have anything to preload nor very complex in their rendering: they are rendered in the end in their inter-dependency order.

About

Object representation of a display layout, based upon CSS basic functionnality

Источник

Php with layout type

Ниже приведён частичный список опций конфигурации, используемых скриптами configure при компиляции в Unix-подобных окружениях. Большинство опций конфигурации приведено в соответствующих местах на страницах с описанием модулей, а не здесь. Чтобы получить полный актуальный список опций конфигурации, запустите ./configure —help в каталоге исходного кода PHP после запуска команды autoconf (смотрите также раздел установки PHP). Вам также может быть интересно почитать документацию команды » GNU configure для получения информации о дополнительных опциях команды configure, таких, как —prefix=PREFIX .

Замечание:

Эти настройки используются только во время компиляции. Если вы хотите изменить конфигурацию PHP во время выполнения, пожалуйста смотрите главу Конфигурация во время выполнения.

Опции конфигурации в PHP

Различные опции

Компилировать с информацией об отладке.

—with-layout=TYPE

Устанавливает, каким образом установленные файлы будут расположены. TYPE принимает значения PHP (по умолчанию) или GNU.

—with-pear=DIR

Установить PEAR в директорию DIR (по умолчанию PREFIX/lib/php).

—without-pear

—enable-sigchild

Включить собственный дескриптор SIGCHLD для PHP.

—disable-rpath

Не передавать дополнительные пути для поиска библиотек времени исполнения.

—enable-libgcc

—enable-php-streams

Включить экспериментальную функциональность потоков PHP. Используйте только в случае, если вы тестируете код!

—with-zlib-dir[=DIR]

Определить местонахождение библиотеки zlib.

—with-tsrm-pthreads

Использовать потоки (threads) POSIX (по умолчанию).

—enable-shared[=PKGS]

Собирать общие библиотеки [по умолчанию=yes].

—enable-static[=PKGS]

Собирать статические библиотеки [по умолчанию=yes].

—enable-fast-install[=PKGS]

Оптимизировать для быстрой установки [по умолчанию=yes].

Предполагать, что компилятор С использует линкер GNU ld [по умолчанию=no].

—disable-libtool-lock

Избегать блокирования (может испортить параллельные сборки).

Пытаться использовать только PIC/не PIC объекты [по умолчанию=use both (использовать оба)]

—enable-versioning

Экспортировать только необходимую информацию для отладки. Смотрите INSTALL для дополнительной информации.

Опции PHP

Включает правила сборки и зависимости make, неиспользуемые (а иногда запутывающие) в обычном установщике.

—with-config-file-path=PATH

Устанавливает путь для поиска php.ini , значение по умолчанию PREFIX/lib .

—disable-short-tags

Запрещает использование краткой формы записи начального тега

Определяет каталог библиотек для сборки PHP в Unix-системах. Для 64-битных систем опция требует особого аргумента —with-libdir=lib64 для директории lib64 .

Включает безопасность потоков. До версии PHP 8.0.0 на системах, отличных от Windows, эта опция называлась —enable-maintainer-zts.

Опции SAPI

Следующий список включает доступные опции SAPI ( Server Application Programming Interface ) для PHP.

—with-apxs[=FILE]

Собирает динамический модуль для Apache. FILE — это опциональный путь к инструменту «Apache apxs», который используется для apxs по умолчанию. Убедитесь в том, что вы указали версию apxs, которая действительно установлена в вашей системе, а не ту, которая находится в исходниках Apache.

—with-apache[=DIR]

Собирает статичный модуль для Apache. DIR — это верхний уровень директории сборки Apache, по умолчанию /usr/local/apache .

—with-mod_charset

Включает таблицы перекодировки для модуля mod_charset (для русской версии Apache).

—with-apxs2[=FILE]

Собирает динамический модуль для Apache 2.0. FILE — это опциональный путь к инструменту «Apache apxs», который используется для apxs по умолчанию.

Отключает сборку CLI-версии PHP (опция также вызывает —without-pear). Больше информации можно получить в разделе Использование PHP в командной строке.

—enable-phpdbg

Включает поддержку модуля SAPI для интерактивного дебаггера phpdbg.

—enable-embed[=TYPE]

Включает сборку встроенной библиотеки SAPI. TYPE может принимать значение shared или static , по умолчанию установлено shared .

—with-servlet[=DIR]

Включает поддержку сервлетов. DIR — это базовая директория установки JSDK. SAPI требует java-модули, может быть собрана как доступная для dl.

Отключает сборку CGI-версии PHP.

Этот аргумент включает FastCGI, который предварительно должен быть включён аргументом —enable-fastcgi .

Источник

Читайте также:  Python check int in range
Оцените статью