Page 1 of 1

Method src does not exist error in laravel

Posted: Tue Sep 29, 2015 3:20 pm
by gautamz07
I was just trying to create a link in laravel like so:

Code: Select all

 <li><a href="products/productspg">products</a></li>
I have a products controller with the following method in it:

Code: Select all

public function getProductpg() {
    return View::make('store.products')
        ->with('products' , Product::take(4)->orderBy('created_at' , 'DESC')->get());
}
Also i have a products view under the store folder, i.e. products.blade.php,

now when i click on the link on the index page on I.E. the below link:

Code: Select all

<li><a href="products/productspg">products</a></li> 
I expect the below view to open:

products.blade.php , instead i get the following error :


http://i.imgur.com/Dukx61B.jpg


Now why am i getting this error , when i try to load even the index page of my app, this is not working , Why ?

Re: Method src does not exist error in laravel

Posted: Tue Sep 29, 2015 4:12 pm
by Celauran
You're calling a method that doesn't exist. With no code posted, I can't say where. I did mention yesterday that Illuminate\HtmlBuilder::src doesn't exist.

Re: Method src does not exist error in laravel

Posted: Wed Sep 30, 2015 12:20 am
by gautamz07
I did have the following line in my main.blade.php file:

{{ HTML::src('http://maxcdn.bootstrapcdn.com/font-awe ... me.min.css'); }}

But i took it off and i still get the same error .

Re: Method src does not exist error in laravel

Posted: Wed Sep 30, 2015 12:27 am
by gautamz07
I tryed the clear cache command ,

http://stackoverflow.com/questions/1890 ... -laravel-4

still getting the same error .

Re: Method src does not exist error in laravel

Posted: Wed Sep 30, 2015 6:23 am
by Celauran
gautamz07 wrote:I did have the following line in my main.blade.php file:

{{ HTML::src('http://maxcdn.bootstrapcdn.com/font-awe ... me.min.css'); }}

But i took it off and i still get the same error .
It's telling you a method src() doesn't exist. I'd start looking for where you're calling that.