PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Oct 20, 2017 7:25 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Nov 23, 2016 2:43 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
Hey guys i just need to understand the below line of code :

Syntax: [ Download ] [ Hide ]
preview:
    path: /preview/{contenttypeslug}
    defaults:
        _controller: controller.frontend:preview
    requirements:
        contenttypeslug: controller.requirement:anyContentType
 


From the above lines of code what does the below line of code really do:

Syntax: [ Download ] [ Hide ]
defaults:
        _controller: controller.frontend:preview
 


??

If i check the docs here https://docs.bolt.cm/2.2/templates/templates-routes#yaml-description-of-a-routing-entry

it says the following:

Quote:
controller method which will be called when this route matches.


But i still don't quite understand this line of code , where is this method exactly and when will it be called ??


Top
 Profile  
 
PostPosted: Wed Nov 23, 2016 6:06 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6390
Location: Montreal, Canada
Which version of Bolt are you using? The routing appears to be from 3.x and you're referencing documentation from 2.x

Bolt uses Symfony routing under the hood, and they have some pretty good documentation also.
http://symfony.com/doc/3.1/routing.html
http://symfony.com/doc/3.1/components/routing.html

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Thu Nov 24, 2016 1:28 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
Wow thanks celauran !

and i am using bolt 3.1+ .. sometimes i referance old docs just to see if i can get a clue :P

Thanks alot ... i'll referance the symfony docs and see what i can understand :D

TY


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group