• Welcome to PHPVIBE Forums. Please log in.
avatar_Marius P.

Check or target routes/views

Started by Marius P.,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marius P.Topic starter

PHPVibe comes with a few simple but efficient conditional functions for components restrictions (all located in lib/functions.php):

is_home() – Returns true if the current page is the homepage
is_video() – Returns true for single video & music pages
is_picture() – Returns true for single image
is_channel() – Returns true for single channel

For all the rest you could use the function is_com($com)
Example:

if(is_com('login')) {
/* You are on the login page */}
To see the components you could check the router declarations in index.php

$router->map('/api/:section', 'api', array('methods' => 'GET', 'filters' => array('section' => '(.*)')));

The structure is RewritenUrl format, Component, arrays of methods.

You could also just


echo com();
to print the current component.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

 

Similar topics (7)

[ Video Sharing CMS v4 ] HELP: License key Check Failed

Started by identicalmedia


Replies: 7
Views: 3114

[ Video Sharing CMS v4 ] License key check with PHPVibe server has failed.

Started by yafe3


Replies: 1
Views: 2955

[ Video Sharing CMS v4 ] checking every 3 hours

Started by maldboy


Replies: 1
Views: 2006

[ Video Sharing CMS v4 ] target the ads

Started by ronyhage


Replies: 4
Views: 1181

[ Video Sharing CMS v4 ] License key check temporary or permanent fail

Started by poyagh


Replies: 4
Views: 3317

[ Video Sharing CMS v4 ] Where is the file responsible for checking if Moderator is logged in?

Started by Rafa


Replies: 1
Views: 1649

[ Video Sharing CMS v4 ] Redtube Video check for cron

Started by pitbullgti


Replies: 8
Views: 2064