/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php
namespace Ayctor\Controllers;
use Ayctor\Utils\Helper;
use Ayctor\Utils\Search;
use WpCore\Controllers\Controller;
class BuildingController extends Controller
{
/**
* View for amenageur.php.
*
* @return string
*/
public function show()
{
$layouts = get_field('building_blocks');
$typologies = Helper::getTypologies(get_the_ID());
$typology = $typologies[0];
if (count($typologies) > 1) {
$color = config('typologies.names.Multi Activité.color');
} else {
$color = config('typologies.names.' . $typology . '.color');
}
if(!$layouts) {
$layouts = [];
}
foreach ($layouts as $key => $layout) {
if ($layout['acf_fc_layout'] == 'layout_related') {
$search = new Search([
'post_type' => 'building',
'typologies' => implode(',', $typologies),
], 0, 3);
$recommended = $search->results();
$layout['related_projects'] = [];
foreach ($recommended as $project) {
$layout['related_projects'][] = $project['_source']['post_id'];
Arguments
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/app/Controllers/BuildingController.php
namespace Ayctor\Controllers;
use Ayctor\Utils\Helper;
use Ayctor\Utils\Search;
use WpCore\Controllers\Controller;
class BuildingController extends Controller
{
/**
* View for amenageur.php.
*
* @return string
*/
public function show()
{
$layouts = get_field('building_blocks');
$typologies = Helper::getTypologies(get_the_ID());
$typology = $typologies[0];
if (count($typologies) > 1) {
$color = config('typologies.names.Multi Activité.color');
} else {
$color = config('typologies.names.' . $typology . '.color');
}
if(!$layouts) {
$layouts = [];
}
foreach ($layouts as $key => $layout) {
if ($layout['acf_fc_layout'] == 'layout_related') {
$search = new Search([
'post_type' => 'building',
'typologies' => implode(',', $typologies),
], 0, 3);
$recommended = $search->results();
$layout['related_projects'] = [];
foreach ($recommended as $project) {
$layout['related_projects'][] = $project['_source']['post_id'];
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
<?php
namespace WpCore\Bootstrap;
use Illuminate\Support\Str;
/**
* Router class for WP Core boilerplate.
* @package WpCore\Bootstrap
*/
class Router
{
/**
* Creates a list populated by the callback's controller and method.
* Calls the function in the list passed as a parameter.
* @param $method
*/
protected static function call_function($callback) {
list($controller, $method) = Str::parseCallback($callback);
call_user_func([new $controller, $method]);
exit();
}
/**
* Checks if the query has no results (404).
* @param $method
*/
public static function is_404($method) {
if (function_exists("is_404") && is_404()) {
self::call_function($method);
}
}
/**
* Checks if you are on the BLOG homepage, if you set a static page as the front page this conditional tag
* will return true only if you are on the page you set as the "Posts page".
* @param $method
*/
public static function is_home($method) {
if (function_exists("is_home") && is_home()) {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
<?php
namespace WpCore\Bootstrap;
use Illuminate\Support\Str;
/**
* Router class for WP Core boilerplate.
* @package WpCore\Bootstrap
*/
class Router
{
/**
* Creates a list populated by the callback's controller and method.
* Calls the function in the list passed as a parameter.
* @param $method
*/
protected static function call_function($callback) {
list($controller, $method) = Str::parseCallback($callback);
call_user_func([new $controller, $method]);
exit();
}
/**
* Checks if the query has no results (404).
* @param $method
*/
public static function is_404($method) {
if (function_exists("is_404") && is_404()) {
self::call_function($method);
}
}
/**
* Checks if you are on the BLOG homepage, if you set a static page as the front page this conditional tag
* will return true only if you are on the page you set as the "Posts page".
* @param $method
*/
public static function is_home($method) {
if (function_exists("is_home") && is_home()) {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/vendor/ayctor/wp-core/src/WpCore/Bootstrap/Router.php
/**
* Checks if the query is for an existing single PAGE.
* @param $page
* @param $method
*/
public static function is_page($method, $page = '') {
if (function_exists("is_page") && is_page($page)) {
self::call_function($method);
}
}
/**
* Checks if the query is for an existing single POST of any of the given types.
* @param $method
* @param string $post_type
*/
public static function is_singular($method, $post_type = '') {
if(function_exists("is_singular") && is_singular($post_type)) {
self::call_function($method);
}
}
/**
* Checks if the query is for an existing single POST.
* @param $method
* @param string $post
*/
public static function is_single($method, $post = '') {
if(function_exists("is_single") && is_single($post)) {
self::call_function($method);
}
}
/**
* Checks if the query is for an existing post type archive page.
* @param $method
* @param string $post_type
*/
public static function is_post_type_archive($method, $post_type = '') {
/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/index.php
<?php
use WpCore\Bootstrap\Router;
Router::is_404('\Ayctor\Controllers\PageController@notFound');
Router::is_home('\Ayctor\Controllers\PageController@index');
Router::is_page('\Ayctor\Controllers\PageController@planSite', 'plan-du-site');
Router::is_page('\Ayctor\Controllers\PageController@references', 'references');
Router::is_page('\Ayctor\Controllers\PageController@page');
Router::is_singular('\Ayctor\Controllers\ProjectController@show', 'project');
Router::is_singular('\Ayctor\Controllers\BuildingController@show', 'building');
Router::is_singular('\Ayctor\Controllers\PageController@post', 'post');
Router::default('\Ayctor\Controllers\PageController@default');
/var/www/faubourg-promotion/www/wp-includes/template-loader.php
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
Arguments
"/var/www/faubourg-promotion/www/wp-content/themes/faubourg-promotion-wp/index.php"
/var/www/faubourg-promotion/www/wp-blog-header.php
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
Arguments
"/var/www/faubourg-promotion/www/wp-includes/template-loader.php"
/var/www/faubourg-promotion/www/index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Arguments
"/var/www/faubourg-promotion/www/wp-blog-header.php"