Answer the question
In order to leave comments, you need to log in
Routing Yii1?
Actually, right now I just started to understand Yii, and got a little stuck. It's not very clear how this routing works. Right now, naturally, the default application out of the box (My web Application), which is actually very confusing for beginners. Right now I want to organize everything from scratch, and the questions are:
1) Where to register the default controller, or will it always look for this same SiteController ?
2) In the same laravel there are so-called "routes", in other words, the routes.php file, in which you register all the controllers and actions that you want to use, and most importantly, you specify the $_GET or $_POST methods, depending on how the data is being transferred .Looks like this in Laravel:
Route::get('/', [ // $_GET
'as' => 'index', // главная страница
'uses' => '[email protected]' //[email protected]
]);
Answer the question
In order to leave comments, you need to log in
1) Where to register the default controller:
in the config (/protected/config/main.php) :
return array(
'defaultController' => 'test', // /protected/controllers/TestController
)
'components'=>array(
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName' => false,
'rules'=>array(
'about' => 'test/actionAbout', // контроллер /protected/controllers/TestController, метод actionAbout()
)
)
)
var stop_mobile_scroll = false;
$('.callback__link').click(function(e){
stop_mobile_scroll = true;
});
$('.popup__close').click(function(e){
stop_mobile_scroll = false;
});
$(document).on('touchmove',function(e){
if (stop_mobile_scroll)
e.preventDefault();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question