/var
/www
/newmedia
/site
/config
/config.php
'action' => function ($semester) {
return page('projects');
}
],
[
'pattern' => 'projects/(:any)/(:any)',
'action' => function ($semester, $project) {
return page('students')->grandChildren()->findBy('project_slug', $project);
}
],
[
'pattern' => 'students/(:any)',
'action' => function ($student) {
return page('students')->children()->findBy('student_slug', $student);
}
],
[
'pattern' => 'students/(:any)/(:any)',
'action' => function ($student, $project) {
return page('students')->children()->findBy('student_slug', $student)->children()->findBy('project_slug', $project);
}
],
[
'pattern' => 'reload/container',
'action' => function () {
if($student = page('students')->children()->shuffle()->first());
if($project = $student->children()->shuffle()->first());
if($image = $project->images()->filterBy('template', '!=', 'thumb')->shuffle()->first()) {
$html = '<div class="project init">';
$html .= '<div class="headline">';
$html .= '<h2><a href="' . site()->url() . '/students/' . $student->student_slug() . '/' . $project->project_slug() . '">' . $student->name() . '</a> — <span class="bold">' . strip_tags($project->project()->kirbytext()) . '</span></h2>';
$html .= '</div>';
$html .= '<div class="gallery">';
$html .= '<img class="gallery" src="' . $image->url() . '" alt="' . $image->filename() . '">';
$html .= '</div>';
$html .= '</div>';
return $html;
}
}
]
/var
/www
/newmedia
/kirby
/src
/Cms
/App.php
}
$urls = array_merge(require static::$root . '/config/urls.php', (array)$urls);
$this->urls = Ingredients::bake($urls);
return $this;
}
/**
* Calls any Kirby route
*
* @return mixed
*/
public function call(string $path = null, string $method = null)
{
$path = $path ?? $this->path();
$method = $method ?? $this->request()->method();
$route = $this->router()->find($path, $method);
$this->trigger('route:before', $route, $path, $method);
$result = $route->action()->call($route, ...$route->arguments());
$this->trigger('route:after', $route, $path, $method, $result);
return $result;
}
/**
* Returns a specific user-defined collection
* by name. All relevant dependencies are
* automatically injected
*
* @param string $name
* @return void
*/
public function collection(string $name)
{
return $this->collections()->get($name, [
'kirby' => $this,
'site' => $this->site(),
'pages' => $this->site()->children(),
'users' => $this->users()
/var
/www
/newmedia
/kirby
/src
/Cms
/App.php
$requestUri = '/' . $this->request()->url()->path();
$scriptName = $_SERVER['SCRIPT_NAME'];
$scriptFile = basename($scriptName);
$scriptDir = dirname($scriptName);
$scriptPath = $scriptFile === 'index.php' ? $scriptDir : $scriptName;
$requestPath = preg_replace('!^' . preg_quote($scriptPath) . '!', '', $requestUri);
return $this->setPath($requestPath)->path;
}
/**
* Returns the Response object for the
* current request
*
* @return Response
*/
public function render(string $path = null, string $method = null)
{
return $this->io($this->call($path, $method));
}
/**
* Returns the Request singleton
*
* @return Request
*/
public function request(): Request
{
return $this->request = $this->request ?? new Request;
}
/**
* Path resolver for the router
*
* @param string $path
* @param string|null $language
* @return mixed
*/
public function resolve(string $path = null, string $language = null)
/var
/www
/newmedia
/index.php
<?php
require 'kirby/bootstrap.php';
echo (new Kirby)->render();