Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get the base url in cakephp ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 3.13k
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss how to get the base url in cakephp ?

    If you want current base or Get current url.

    You can take reference of bellow example
    suppose your project URL is http://localhost/project_path

    You can use any one method of following :

     <?php 
    
        echo $this->Html->url('/', true)
    
        echo $this->Html->url('/');
    
        ?>
    

    This is a also very important method to find base URL in cakephp

    Define constant in Config/core.php as given bellow:

    define("BASE_URL", "www.yourprojectsite.com/");
    

    The help of this method you can use BASE_URL anywhere in your project

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: