本文整理汇总了PHP中View::show方法的典型用法代码示例。如果您正苦于以下问题:PHP View::show方法的具体用法?PHP View::show怎么用?PHP View::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$view = new View();
$view->show('header.php', array('title' => 'Home'));
$view->show('home.php');
$view->show('footer.php');
}
示例2: bierenOverzicht
private function bierenOverzicht()
{
$bierenModel = new Bieren_model();
$bieren = $bierenModel->bieren();
$view = new View();
$view->show('header.php', array('title' => 'Overzicht van de bieren'));
$view->show('bieren_overview.php', array('bieren' => $bieren['data']));
$view->show('footer.php');
}
示例3: bierenIndividueel
private function bierenIndividueel($id)
{
$bierenModel = new Bieren_model();
$bier = $bierenModel->bieren($id);
$view = new View();
$view->show('header.php', array('title' => ''));
$view->show('bieren_individueel.php', array('bier' => $bier['data'][0]));
$view->show('footer.php');
}
示例4: showIndex
public function showIndex()
{
$data['title'] = 'Overzicht van MVC: step 3';
View::show('header', $data);
View::show('index-body');
View::show('footer');
}
示例5: show
protected function show($response = null) {
parent::show($response);
header("Content-Type: text/javascript");
echo "<script type='text/javascript'>";
echo "var ".$this->getOperation()." = ".json_encode($response);
echo "</script>";
}
示例6: index
function index()
{
$contacts_model = new ContactsModel();
$contacts = $contacts_model->get_contacts();
// var_dump($contacts);die;
$view = new View();
$view->set_file_name('contacts');
$params = array('contacts' => $contacts);
$view->show($params);
}
示例7: index
function index()
{
$bio_model = new BioModel();
$bio = $bio_model->get_bio();
// var_dump($bio);die;
$view = new View();
$view->set_file_name('bio');
$params = array('bio' => $bio);
$view->show($params);
}
示例8: index
function index()
{
$photo_model = new PhotoModel();
$photo = $photo_model->get_photo();
// var_dump($photo);die;
$view = new View();
$view->set_file_name('photo');
$params = array('photo' => $photo);
$view->show($params);
}
示例9: index
function index()
{
$video_model = new VideoModel();
$video = $video_model->get_video();
// var_dump($video);die;
$view = new View();
$view->set_file_name('video');
$params = array('video' => $video);
$view->show($params);
}
示例10: NewsModel
function news_one_show($id = null)
{
$one_news_model = new NewsModel();
$one_news = $one_news_model->get_one_news($id);
// var_dump($news);die;
$view = new View();
$view->set_file_name('admin_news_one');
$params = array('news' => $one_news);
$view->show($params);
}
示例11: show
public function show($response) {
parent::show($response);
header("Content-Type: text/javascript");
$p = filter_input(INPUT_GET, $this->query_variable ,FILTER_SANITIZE_STRING);
if ( (!is_null($p)) && ($p!=false) ) {
echo "if (typeof ".$p." === 'function' ) $p( ".json_encode($response, $this->json_encode_options)." ); else console.log('Function ".$p." not found.'); ";
} else {
$this->setError("Jsonp function is requered", 3004);
}
}
示例12: showArtikel
public function showArtikel($id)
{
# Haal data op op basis van het ID dat in de url staak (=de hook)
$articleData = $this->model->getArticle($id);
# Prepare data voor in body
$data['artikel'] = $articleData['data'][0];
# Zet title in head
$data['title'] = $data['artikel']['titel'];
View::show('header', $data);
View::show('artikel-enkel-body', $data);
View::show('footer');
}
示例13: show
public function show($response) {
parent::show($response);
if (file_exists( $this->phpfile )) {
$_VIEW = array();
$_VIEW["OPERATION"] = $this->getOperation();
$_VIEW["RESPONSE"] = $response;
$_VIEW["ATTRIBUTES"] = $this->attributes;
$GLOBALS["_VIEW"] = $_VIEW;
include $this->phpfile;
} else {
$this->setError("PHP ".$this->phpfile." file not found", 3003);
}
}
示例14: edit
private function edit()
{
Base::requireAdmin();
if (!isset($_POST['page']) && !isset($_POST['draft'])) {
// Preparations for View
View::set('page', $this->page);
View::show('page/edit');
}
// Token
$this->page->title = $_POST['title'];
// Filter
$this->page->slug = Base::slug($_POST['title']);
$this->page->html = $_POST['html'];
$this->page->published = isset($_POST['page']);
$this->page->save();
// Successfully edited
Base::redirect('/page/' . $this->page->slug, 'Page successfully edited');
}
示例15: explore
private function explore()
{
// Get some tags to show as options
$tags = Tag::select('name')->limit(30)->findArray();
View::set('tags', $tags);
// No tags selected
if (empty($_GET['t']) || !Validate::tags($_GET['t'])) {
$rows = Playlist::join('user', 'user_id = u.id', 'u')->selectMany('playlist.*', 'username')->where('published', 1)->paginate();
Base::eagerLoadingPlaylistTags($rows);
View::set('playlists', $rows);
View::show('explore');
}
// Separate tags by spaces
$tags = trim($_GET['t']);
$tags = explode('/', $tags, 4);
$tags = array_slice($tags, 0, 3);
// Url for selected tags
$selectedTagsUrl = implode('/', $tags);
// Beautifys the title Tags
$selectedTags = array();
foreach ($tags as $key => $item) {
// Removes empty tags
if (empty($item)) {
unset($tags[$key]);
continue;
}
$aux = array();
$aux['name'] = $item;
// When one clicked will remove that tag from the query
unset($tags[$key]);
$aux['href'] = '/' . implode('/', $tags);
$tags[$key] = $item;
$selectedTags[] = $aux;
}
$playlists = Playlist::filter('byTags', $tags)->join('user', 'p.user_id = u.id', 'u')->selectMany('p.*', 'username');
$count = $playlists->countDistinct('p.id');
$playlists = $playlists->groupBy('p.id')->paginate($count);
Base::eagerLoadingPlaylistTags($playlists);
// View preparations
View::set('playlists', $playlists);
View::set('selectedTags', $selectedTags);
View::set('selectedTagsUrl', $selectedTagsUrl);
View::show('explore');
}