netcommons
 
 
 

Init.class.php

プログラムを記述するファイル。

view/main/init/Init.class.php
<?php
class Hello_View_Main_Init extends Action
{
  function execute()
  {
    return 'success';
  }
}
?>

アクション毎に記述する。
helloworld_view_main_init に対応する。

ファイルの配置される場所 view/main/init/Init.class.php と
クラス名Hello_View_Main_Initは、
アクション名に対応して一意的に決められる。

execute()は固定的に使用される関数名である。
デフォルトは success を返すだけ。
その後の処理は view/main/init/maple.ini に記述される。

この手引きでの扱い
Viewプログラムの項で変更する。

参考
PHPクラスファイル(Action)の記述方法
 

もっと詳しく

このファイルは view/main/init/maple.ini の [Action] にて読込みが指示される。
Filter_Action により読み込まれる。
下記のようなプログラムの実行で読み出される。

Controller->execute()
-> FilterChain->execute()
-> Filter_Action->execute()
-> ActionExtraChain->execute()
-> Pages_View_Main->execute()
--> Headerinc_View_Main->execute()
====> view/maple.ini
====> view/main/init/maple.ini
-> Preexecute_Main->preExecute()
--> ConfigExtraUtils->execute()
====> view/maple.ini
====> view/main/init/maple.ini
--> FilterChain->execute()
--> Filter_SmartyAssign->execute()
====> language/japanese/main.ini
--> FilterChain->execute()
--> Filter_Action->execute()
--> ActionExtraChain->execute()
====> view/main/init/Init.class.php
      Hello_View_Main_Init->execute()

webapp/modules/pages/view/main/Main.class.php
class Pages_View_Main extends Action {
function execute() {
// ページ内のブロックを取得
    $blocks = $this->blocksView->getBlockByPageId($page_id_arr);
// アクションを実行
    $html[$block['block_id']] =
        $this->preexecute->preExecute(
            $block['action_name'], $params);
// テンプレートにアサイン
    $this->_renderer->assign(
        'content_center_field',
        $this->pagesCompmain->setPageFetch(... $html ...));
}

webapp/components/preexecute/Main.class.php
class Preexecute_Main {
function preExecute( ... ) {   
    $this->_actionChain->add($actionName);
}

maple/filter/Filter_Action.class.php
class Filter_Action extends Filter {
function execute() {
    $view = $actionChain->execute();
}

maple/nccore/ActionExtraChain.class.php
class ActionExtraChain extends ActionChain {
function add($name) {
// ファイルの読み込み
    include_once($filename);
}
function execute() {
// ファイルの実行
    return $action->execute();
}
 
yn150
 

メニュー

ネットコモンズのサポート会議室ネットコモンズの有償サービスこのサイトの使用方法ネットコモンズの運用事例ネットコモンズの構築事例配布モジュール一覧グーグル地図モジュールのデモグーグルカレンダーモジュールのデモグーグル検索モジュールのデモOpenID モジュールのデモTwitterモジュールのデモFacebookモジュールのデモFacebook 風 掲示板ヘッダチェンジャー・モジュールのデモテーマのデモヘッダー部なしモジュール開発の手引き解体新書お問合せ練習場

携帯アクセス

qr code