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


PHP HTMLPage::add_style方法代碼示例

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


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

示例1: index

 public function index()
 {
     if ($post = $this->input->post('contact')) {
         $validation = new Validation($post);
         $validation->pre_filter('trim')->add_rules('email', 'email', 'required')->add_rules('subject', 'required')->add_rules('body', 'required');
         if (!$validation->validate()) {
             return $this->template->content = Kohana::debug($validation->errors());
         }
         $post = $validation->as_array();
         $message = sprintf("%s used the contact form to say: \n\n %s", $post['email'], $post['body']);
         $subject = sprintf('[ProjectsLounge Contact] %s', $post['subject']);
         email::send('horia@hdragomir.com', 'contact@projectslounge.com', $subject, $message);
         return url::redirect('contact/thanks');
     }
     HTMLPage::add_style('forms');
     HTMLPage::add_style('contact');
     $this->template->content = View::factory('contact/form');
 }
開發者ID:hdragomir,項目名稱:ProjectsLounge,代碼行數:18,代碼來源:contact.php

示例2: edit

 public function edit($id)
 {
     $user = User_Model::current();
     $project = ORM::factory('project', $id);
     if (!$user->loaded && $project->user_can($user, 'edit')) {
         return $this->template->content = 'oh, come on!';
     }
     if ($post = $this->input->post('project')) {
         $validation = Projects_utils::projects_edit_validation($post);
         if (!$project->validate($validation, true)) {
             return $this->template->content = Kohana::debug($validation->errors());
         }
         if ($additional_user_emails = $this->input->post('additional_user_emails')) {
             $additional_user_roles = $this->input->post('additional_user_roles');
             foreach ($additional_user_emails as $email) {
                 Profiles_utils::reserve_email_if_available($email);
             }
             $additional_users = array_combine($additional_user_emails, $additional_user_roles);
             $project->add_user_roles($additional_users);
         }
         url::redirect($project->local_url);
     } else {
         HTMLPage::add_style('forms');
         $this->template->content = View::factory('projects/edit')->bind('project_types', Projects_utils::get_project_types_dropdown_array())->bind('project', $project)->bind('user', $user);
     }
 }
開發者ID:hdragomir,項目名稱:ProjectsLounge,代碼行數:26,代碼來源:projects.php


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