Method src does not exist error in laravel

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Method src does not exist error in laravel

Post 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 ?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Method src does not exist error in laravel

Post 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.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Method src does not exist error in laravel

Post 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 .
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Method src does not exist error in laravel

Post by gautamz07 »

I tryed the clear cache command ,

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

still getting the same error .
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Method src does not exist error in laravel

Post 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.
Post Reply