Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.

Post Page Advertisement [Top]

How to define path in Php

1: define it in core.php file in cakephp

define('HTTP_ROOT','http://'.$_SERVER['HTTP_HOST'].'/');


2: define third-party url in expression engine

define('HTTP_THIRD_PARTY','https://'.$_SERVER['HTTP_HOST'].'/system/expressionengine/third_party/');

3. defines route path in cakephp 

Router::connect('/', array('controller' => 'Homes', 'action' => 'index'));

Router::connect('/admin', array('controller' => 'users', 'action' => 'login', 'prefix' => 'admin', 'admin' => true, 'layout' => 'default'));


How to define path in jQuery

var host = window.location.host;
var proto = window.location.protocol;
var ajax_url = proto+"//"+host+"/";

No comments:

Post a Comment

Bottom Ad [Post Page]