Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is $this->HTML->url and $this->HTML->link in cakephp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.2k
    Comment on it

    $this->HTML->url takes two arguments one is url containing routing array and other is boolean value which is either true or false.It returns a url which points to a combination of controller and action.It boolean value is true it prepend the base url if false it will not.

    echo $this->Html->url(array(
        "controller" => "mycontroller",
        "action" => "myaction",
        "bar"
    ));
    

    $this->HTML->link is used to generate a link in cakephp. It takes an array of options as parameters to do this.

     echo $this->Html->link(
            'Enter',
            '/pages/home',
            array('class' => 'button', 'target' => '_blank')
        );
    

 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: