Изтегли пълният
PDF каталог сега
Поръчай луксозен
хартиен каталог
Array

Composite components

18.04.2009

Example

Consider a simple example of how a news composite component may function. Say we have the following simple components: "list of news" and "news details", the latter takes the ID of news to be displayed as input parameter.

The news site section can be created, for example, by adding the "list of news" component to a section index page, and creating a news.php page and adding the "news details" component to it. The components must be properly configured: the list of news is to be able to build links to a news details page including the news ID; the news details component should have input parameters configured in such a way that it would be able to display a link to the list of news.

Configuring the components properly requires that we know the path to the news details page, the name of all parameters that the components can take on input, etc. Even in this example, configuring may be a headache. But imagine tenths of forum components!

An easier alternative that a web developer can take is using the news composite component. You can simply add this component to the index page. The component will take full control over maintaining correct links and parameters; this will not require any additional actions on the developer side. Creating the news composite component requires that you check the news ID in URL's. If an URL contains the news ID, the component will activate the page that would display the news text. Otherwise, the component would display the list of news.

Pages of the composite component template would connect simple components and configure their input parameters properly. Simple components will carry out their functions as usual; the only important thing is configuring the input parameters correctly.

Thus, the MVC pattern flow works as follows:


Page 2 - 2 от 2
Начало | Пред. | 1 2 | След. | Край

Брой показвания: 1541

Назад към списъка

Array
(
    [SESS_AUTH] => Array
        (
            [POLICY] => Array
                (
                    [SESSION_TIMEOUT] => 600
                    [SESSION_IP_MASK] => 0.0.0.0
                    [MAX_STORE_NUM] => 10
                    [STORE_IP_MASK] => 0.0.0.0
                    [STORE_TIMEOUT] => 525600
                    [CHECKWORD_TIMEOUT] => 2880
                    [PASSWORD_LENGTH] => 6
                    [PASSWORD_UPPERCASE] => N
                    [PASSWORD_LOWERCASE] => N
                    [PASSWORD_DIGITS] => N
                    [PASSWORD_PUNCTUATION] => N
                    [PASSWORD_CHECK_WEAK] => N
                    [PASSWORD_CHECK_POLICY] => N
                    [PASSWORD_CHANGE_DAYS] => 0
                    [PASSWORD_UNIQUE_COUNT] => 0
                    [LOGIN_ATTEMPTS] => 0
                    [BLOCK_LOGIN_ATTEMPTS] => 0
                    [BLOCK_TIME] => 0
                )

        )

    [SESS_IP] => 18.116.61.213
    [SESS_TIME] => 1741936458
    [IS_EXPIRED] => 
    [BX_SESSION_SIGN] => 59cddefb7314fff30df04fb0e307d887
    [SESS_OPERATIONS] => Array
        (
        )

    [fixed_session_id] => f5dfc790f62e5f60c8d7526dd98da806
    [referer1] => 
    [referer2] => 
    [referer3] => 
    [SESS_SEARCHER_CHECK_ACTIVITY] => Y
    [SESS_SEARCHER_ID] => 185
    [SESS_SEARCHER_NAME] => bot
    [SESS_SEARCHER_SAVE_STATISTIC] => N
    [SESS_SEARCHER_HIT_KEEP_DAYS] => 
    [IKWErji3GcXTN0KhdXg5Xh4I4jZTpgA4_BITRIX_CONVERSION_CONTEXT_s1] => 
    [IKWErji3GcXTN0KhdXg5Xh4I4jZTpgA4___store] => 
    [SESS_SHOW_INCLUDE_TIME_EXEC] => 
    [IBLOCK_COUNTER] => Array
        (
            [0] => 1
        )

)