當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Block::findByName方法代碼示例

本文整理匯總了PHP中Block::findByName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Block::findByName方法的具體用法?PHP Block::findByName怎麽用?PHP Block::findByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Block的用法示例。


在下文中一共展示了Block::findByName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

<?php

/** handle submission **/
if (isset($_POST['submit'])) {
    $content = "<table>";
    foreach ($_POST as $key => $val) {
        $tokens = explode("_", $key);
        $key = "";
        foreach ($tokens as $token) {
            $key .= ucfirst($token) . " ";
        }
        $content .= "<tr><th>{$key}</th><td>{$val}</td></tr>";
    }
    $content .= "</table>";
    sendemailAdmin($settings['sitename'] . " - Apply for course", $content);
    Message::register(new Message(Message::SUCCESS, 'Thank you for your application. We will contact you soon!'));
}
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => 'Apply for a course', 'body_class' => 'page page-template page-template-templates page-template-full-width page-template-templatesfull-width-php has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/apply', array('full_page_sidebar_right' => $html->render('site/components/full_page_sidebar_right', array('blocks' => array(Block::findByName('Get in Touch'))))));
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:27,代碼來源:apply.php

示例2: uri

          <li>
            <a href="<?php 
    echo uri('news/' . $news->getId());
    ?>
"><?php 
    echo $news->getTitle();
    ?>
</a>
          </li>
<?php 
}
?>
        </ul>
      </aside>
    </div>

    <div class="widgets widgets-4 one-fourth">
      <aside class="widget widget-educator-contact" id="widget_educator_contact-3">
        <h3 class="widget-title">Get in Touch</h3>
        <div class="text">
          <p><?php 
echo Block::findByName('Footer Right');
?>
</p>
        </div>
      </aside>
    </div>
  </div>
</footer>

開發者ID:jeffreycai,項目名稱:ct21,代碼行數:29,代碼來源:footer.tpl.php

示例3: dispatch

<?php

/** $page has already been assigned by Page module **/
// forward 404 if not published
if (!$page->getPublished()) {
    dispatch('site/404');
    exit;
}
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => $page->getTitle(), 'body_class' => 'page page-template page-template-templates page-template-full-width page-template-templatesfull-width-php has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/page/default', array('breadcrumb' => $html->render('site/components/breadcrumb', array('items' => array('Home' => uri(''), $page->getTitle() => false))), 'page' => $page, 'full_page_sidebar_right' => $html->render('site/components/full_page_sidebar_right', array('blocks' => array(Block::findByName('Get in Touch'), Block::findByName('Apply Now'))))));
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:18,代碼來源:default.php

示例4: str_replace

            $file = str_replace(WEBROOT . DS, "", $newname);
        }
        $rtn[] = $file;
    }
    $object->setIeltsTranscripts(implode("\n", $rtn));
    $object->setCreatedAt(time());
    if ($error_flag == false) {
        if ($object->save()) {
            Message::register(new Message(Message::SUCCESS, i18n(array("en" => "Thanks for your application. We will come back to you as soon as possible.", "zh" => "記錄保存成功"))));
            sendemailAdmin('Apply for course', '<p>A new application for course has just been submitted: <br /><a href="http://en.ct21.com.au/admin/application/edit/' . $object->getId() . '">http://en.ct21.com.au/admin/application/edit/' . $object->getId() . '</a></p>');
            HTML::forwardBackToReferer();
        } else {
            Message::register(new Message(Message::DANGER, i18n(array("en" => "Record failed to save", "zh" => "記錄保存失敗"))));
        }
    }
}
// bootstrap field widgets
FormWidgetPlupfile::bootstrap('graduation_certificate');
FormWidgetPlupfile::bootstrap('degree_certificate');
FormWidgetPlupfile::bootstrap('academic_transcripts');
FormWidgetPlupfile::bootstrap('ielts_transcripts');
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => 'Apply for a course', 'body_class' => 'page page-template page-template-templates page-template-full-width page-template-templatesfull-width-php has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/apply_form', array('object' => new Application(), 'full_page_sidebar_right' => $html->render('site/components/full_page_sidebar_right', array('blocks' => array(Block::findByName('Get in Touch'))))));
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:31,代碼來源:apply_form.php

示例5: Message

        Message::register($messages);
        HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
    }
    // check spam
    if (module_enabled('form') && !Form::checkSpamToken('global contact form')) {
        $message = new Message(Message::DANGER, i18n(array('en' => 'Form login session expired. Please try again', 'zh' => '表單提交時限過期,請重新嘗試登錄')));
        Message::register($message);
        HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
    }
    /** success action **/
    Message::register(new Message(Message::SUCCESS, i18n(array('en' => 'Thank you for your contact ;) We will get back to you soon.', 'zh' => '感謝您的留言 ;) 我們會及時和您溝通'))));
    if (module_enabled('mail')) {
        $message = array();
        foreach ($_POST['contact'] as $key => $val) {
            $message[] = "<p><strong>{$key}</strong>:<br />" . str_replace("\n", "<br />", $val) . "</p><br />";
        }
        $message = implode("\n", $message);
        sendemailAdmin('Site contact form', $message);
    }
    HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
}
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => 'Contact', 'body_class' => 'page page-template page-template-templates page-template-full-width page-template-templatesfull-width-php has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/contact', array('pagetitle' => $page->getTitle(), 'content' => $page->getContent(), 'googlemap' => $html->render('site/components/googlemap', array('latitude' => '-33.877348', 'longitude' => '151.2079613')), 'full_page_sidebar_right' => $html->render('site/components/full_page_sidebar_right', array('blocks' => array(Block::findByName('Get in Touch'), Block::findByName('Apply Now'))))));
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:31,代碼來源:contact.php

示例6: uri

          <a href="<?php 
echo uri('news');
?>
">Check all news &raquo;</a>
        </div>
      </div>
      <div class="dm3-one-half dm3-column-last" id="video-container">
        <iframe width="560" height="315" src="<?php 
echo $youtube_url;
?>
" frameborder="0" allowfullscreen></iframe>
        <div id="shortcuts">

              <div class="dm3-box-icon dm3-box-icon-center">
                <div class="dm3-box-icon-icon">
                  <span class="fa fa-search"></span>
                </div>
                <div class="dm3-box-icon-content">
                  <?php 
echo Block::findByName('Course search');
?>
                </div>
              </div>

        </div>
      </div>
      
      <div class="clear"></div>
    </div>
  </div>
</section>
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:31,代碼來源:latest_news.tpl.php

示例7: array

<?php

// get youtube video url from block
$block = Block::findByName('Youtube video');
$matches = array();
preg_match('/www.youtube.com\\/embed\\/([^\\<&]+)/', $block, $matches);
if (isset($matches[1])) {
    $youtube_id = $matches[1];
} else {
    preg_match('/www.youtube.com\\/watch\\?v=([^\\<&]+)/', $block, $matches);
    $youtube_id = $matches[1];
}
$youtube_url = isset($youtube_id) ? "https://www.youtube.com/embed/{$youtube_id}" : 'https://www.youtube.com/embed/jiBxpdobg0E';
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => $settings['sitename'], 'body_class' => 'home page page-id-115 page-template-default has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/components/slider', array('carousels' => Carousel::findAll()));
$html->renderOut('site/components/latest_news', array('youtube_url' => $youtube_url));
$html->renderOut('site/components/countries_block', array('title' => 'Apply for oversea study', 'countries' => Country::findAll()));
$html->renderOut('site/components/testimonial');
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:26,代碼來源:index.php


注:本文中的Block::findByName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。