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


PHP Block::add_block方法代碼示例

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


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

示例1: Admin

if ($GroupNo == 3) {
    $user = new Admin();
}
if ($GroupNo == 2) {
    $user = new Warden();
}
if (!$user->isLoggedIn()) {
    Redirect::to('login.php');
}
if (@$_POST['block_id']) {
    $validate = new Validate();
    $validation = $validate->check($_POST, array('block_id' => array('required' => true, 'unique' => 'block'), 'num_of_rooms' => array('required' => true, 'min' => 1), 'gender_code' => array('required' => true)));
    if ($validation->passed()) {
        $block = new Block();
        try {
            $block->add_block(array('block_id' => Input::get('block_id'), 'block_cap' => Input::get('num_of_rooms'), 'block_gen' => Input::get('gender_code')));
            echo 'Block ' . Input::get('block_id') . ' added';
        } catch (Exception $e) {
            die($e->getMessage());
        }
    } else {
        echo 'Validation failed';
        foreach ($validation->errors() as $error) {
            $displayerror .= $error . '<br>';
        }
        Session::flash('error', $displayerror);
    }
}
if (@$_POST['room_id']) {
    $validate = new Validate();
    $validation = $validate->check($_POST, array('room_id' => array('required' => true), 'block_id' => array('required' => true), 'room_cap' => array('required' => true, 'min' => 1), 'room_price' => array('required' => true, 'numbered' => true)));
開發者ID:Jaironlanda,項目名稱:Hostel-Management-System,代碼行數:31,代碼來源:Block.php

示例2: save_block_children

 public function save_block_children()
 {
     $this->BuilderEngine->set_page_path($_REQUEST['page_path']);
     $name = $_REQUEST['name'];
     //$page_path 	= mysql_real_escape_string($_REQUEST['page']);
     $children = json_decode($_REQUEST['children']);
     //$version_id = $this->versions->get_pending_page_version_id($page_path);
     $block = new Block($name);
     $block->load();
     $block->remove_children();
     foreach ($children as $child_name) {
         $child = new Block($child_name);
         $block->add_block($child);
     }
     $block->save();
     //$this->db->query("UNLOCK TABLES");
 }
開發者ID:hyrmedia,項目名稱:builderengine,代碼行數:17,代碼來源:ajax.php

示例3:

      <?php 
$block4->html('{content}');
?>
      <?php 
$block4->set_content('<hr />                  
        <p class="copy">
        <!-- Copyright Bar -->
        Copyright &copy; <a href="/index.php">Your Site</a> | Powered by <a href="http://www.builderengine.com">BuilderEngine</a> | <a href="/admin">Edit this website</a>
        </p>
      ');
?>


      
      <?php 
$footer->add_block($block1);
?>
      <?php 
$footer->add_block($block2);
?>
      <?php 
$footer->add_block($block3);
?>
      <?php 
$footer->add_block($block4);
?>
      <?php 
$footer->show();
?>

  </div>
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:footer.php

示例4: Block

            <?php 
$block1->set_resizable(false);
?>
            <?php 
$block1->add_css_class('resume');
?>
            <?php 
$block1->set_content('
               <h2>John Murphy <span class="rsmall"><span class="color">@</span> Web Guru</span></h2>
               <p>Duis a risus sed dolor placerat semper quis in urna. Nam risus magna, fringilla sit amet blandit viverra, dignissim eget est. Ut commodo ullamcorper risus nec mattis. Donec aliquet convallis tortor, et placerat quam posuere posuere. Morbi tincidunt posuere turpis eu laoreet. Nulla facilisi. Aenean at massa leo. Vestibulum in varius arcu.</p>
               <hr />
               <!-- Resume -->
            ');
?>
            <?php 
$holder->add_block($block1);
?>
			
<!-- 2nd Line of Blocks -->

            <?php 
$block2 = new Block('business-commodore-1-theme-resume-content');
?>
            <?php 
$block2->set_type('resume');
?>
            <?php 
$block2->set_resizable(false);
?>
            <?php 
$block2->add_css_class('resume');
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:resume.php

示例5:

$line3->set_content('
                           <div class="span9">
                              <!-- First line -->
                              <p class="cbig">BuilderEngine - The HTML5 Website Builder & CMS Platform</p>
                              <!-- Second line -->
                              <p class="csmall">Design professional looking websites with our complete GUI controlled Design Builder that will revolutionize theme creation & updating with HTML5 / CSS3.</p>
                           </div>
                           <div class="span2">
                              <!-- Button -->
                              <div class="button"><a href="http://www.builderengine.com">Free Account</a></div>
                           </div>
                        ');
?>

					 <?php 
$holder->add_block($line1);
?>
                     <?php 
$holder->add_block($line2);
?>
                     <?php 
$holder->add_block($line3);
?>
                     <?php 
$holder->show();
?>

                  </div>
               </div>
            
         </div>
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:service.php

示例6: get_footer

                ');
?>
            <?php 
$line3->add_block($block2);
?>
			
<!-- 4th Line of Blocks --> 
			
            <?php 
$line4 = new Block("rpost-test");
?>
            <?php 
$line4->set_type('pro_rpost');
?>
            <?php 
$line4->set_size('span12');
$content_holder->add_block($line1);
$content_holder->add_block($line2);
$content_holder->add_block($line3);
$content_holder->add_block($line4);
$content_holder->show();
?>
            </div>           
         </div>
      </div>
</div> 

<!-- Content ends --> 

<?php 
echo get_footer();
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:home.php

示例7: Block

 function add_block($parent, $type)
 {
     $page_path = $_POST['page_path'];
     PC::page_paths($page_path);
     $this->BuilderEngine->set_page_path($page_path);
     //$this->blocks->set_page_path($this->blocks->get_page_path_of($parent));
     $max_id = $this->blocks->get_max_block_id();
     $new_id = $max_id + 1;
     $new_block_name = "custom-block-" . $new_id;
     $block = new Block($parent);
     $block->load();
     $new_block = new Block($new_block_name);
     $new_block->set_type($type);
     $block->add_block($new_block);
     $block->save();
     $new_block->set_content("Your new block.");
     $new_block->show();
 }
開發者ID:hscale,項目名稱:builder-engine,代碼行數:18,代碼來源:ajax.php

示例8:

                        <?php 
$line5->set_content('
                           <div class="span9">
                              <!-- First line -->
                              <p class="cbig">BuilderEngine - The HTML5 Website Builder & CMS Platform</p>
                              <!-- Second line -->
                              <p class="csmall">Design professional looking websites with our complete GUI controlled Design Builder that will revolutionize theme creation & updating with HTML5 / CSS3.</p>
                           </div>
                           <div class="span2">
                              <!-- Button -->
                              <div class="button"><a href="http://www.builderengine.com">Free Account</a></div>
                           </div>
                        ');
?>
                        <?php 
$holder->add_block($line1);
?>
                        <?php 
$holder->add_block($line2);
?>
                        <?php 
$holder->add_block($line4);
?>
                        <?php 
$holder->add_block($line5);
?>
                        <?php 
$holder->show();
?>
                        
                  </div>
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:projects.php

示例9: Block

?>

                        <?php 
$block1->save();
?>
                        <?php 
$block2 = new Block('be-module-blog-entry-right-about');
?>
                        <?php 
$block2->set_size('span4');
?>
                        <?php 
$block2->set_default("\n                        <div class=\"widget\">\n                        <h4>About</h4>\n                        <p>Nulla facilisi. Sed justo dui, id erat. Morbi auctor adipiscing tempor. Phasellus condimentum rutrum aliquet. Quisque eu consectetur erat. Proin rutrum, erat eget posuere semper, <em>arcu mauris posuere tortor</em>,velit at <a href=\"#\">magna sollicitudin cursus</a> ac ultrices magna. Aliquam consequat, purus vitae auctor ullamcorper, sem velit convallis quam, a pharetra justo nunc et mauris. </p>\n                      </div>");
?>
                        <?php 
$right->add_block($block1);
?>
                        <?php 
$right->add_block($block2);
?>
                        <?php 
$right->show();
?>

                        </div>
                     </div>
                     
                     
                     
                  </div>
               </div>
開發者ID:hscale,項目名稱:builder-engine,代碼行數:31,代碼來源:blog_entry.php

示例10: Block

                     <?php 
$block = new Block("business-commodore-1-theme-blank-block-" . $page->id);
?>
                     <?php 
$block->set_size('span12');
?>
                     <?php 
$block->set_content('
                        <h1>Blank Page</h1>
                        <p>Edit this block or add an new block.</p>
                        ');
?>

                     <?php 
$holder->add_block($block);
?>
                     <?php 
$holder->show();
?>
                     
                  </div>
               </div>
            </div>          
            
         </div>
      </div>
   </div>
</div>   

<!-- Content ends --> 
開發者ID:hscale,項目名稱:builder-engine,代碼行數:30,代碼來源:blank.php


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