本文整理匯總了PHP中Website::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Website::initialize方法的具體用法?PHP Website::initialize怎麽用?PHP Website::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Website
的用法示例。
在下文中一共展示了Website::initialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: operations
public function operations($type)
{
switch ($type) {
case 'general_settings':
$this->load->model('entities/website');
$temp = new Website();
$temp->initialize($this->input->post());
WebsiteManagement::update_website($temp);
redirect(base_url() . "panel/general_settings", "location");
break;
case 'supprimer_portfolio':
$data = $this->input->get();
$id = $data['id'];
PortfolioManagement::delete_portfolio_content($id);
redirect(base_url() . "panel/page/portfolio", "location");
break;
case 'supprimer_post':
$data = $this->input->get();
$id = $data['id'];
BlogManagement::delete_blog_post($id);
break;
case 'editer_post':
$this->load->model('entities/Post');
$post = BlogManagement::get_post($this->input->post('id'));
$post->title = $this->input->post('title');
$post->description = $this->input->post('description');
$post->content = $this->input->post('content');
BlogManagement::update_blog_post($post);
echo 'ok';
break;
case 'ajouter_post':
$this->load->model('entities/Post');
$temp = new Post();
$temp->initialize($this->input->post());
BlogManagement::insert_blog_post($temp);
echo 'ok';
break;
case 'upload_slider_image':
# Started working with file upload.
$validFiles = array('upload_path' => './assets/front/img/slider_images', 'allowed_types' => 'jpg|png', 'file_name' => 'slider_image_' . $this->input->post('slide_to_update') . '.jpg', 'max_size' => 250000, 'overwrite' => TRUE);
$this->load->library('upload', $validFiles);
$this->load->model('entities/SliderImage');
$slider_entry = SliderManagement::get_slider_entry($this->input->post('slide_to_update'));
$slider_entry->title = $this->input->post('article_title');
$slider_entry->description = $this->input->post('article_description');
if ($this->upload->do_upload('to_upload_image')) {
$slider_entry->image = 'slider_image_' . $this->input->post('slide_to_update') . '.jpg';
} else {
echo $this->upload->display_errors();
}
SliderManagement::update_slider($slider_entry);
redirect(base_url() . "panel/page/accueil", "location");
break;
default:
break;
}
}