Logo
X
  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web
    • Mobile
    • Enterprise
    • Artificial Intelligence
    • Blockchain
    • DevOps
    • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social
      Responsibility
    • Partners
    • Careers
  • Resources
    • Blog

    • E-Books

    • Case Studies

    • View all resources

  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web

      Create responsive web apps that excel across all platforms

    • Mobile

      User centric mobile app development services that help you scale.

    • Enterprise

      Innovation-driven enterprise services to help you achieve more efficiency and cost savings

      • Domains
      • Artificial Intelligence
      • DevOps
      • Blockchain
      • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social Responsibilities
    • Partners
    • Careers
  • Resources
    • Blog

      Insights for building and maintaining your software projects

    • E-Books

      Our publications for the connected software ecosystem

    • Case Studies

      The impact that we have created for our clients

    • View all resources
daffodil-logo
Get in Touch
  • What We Do
    • Product Engineering

    • Discover & Frame Workshop
    • Software Development
    • Software Testing
    • Managed Cloud Services
    • Support & Maintenance
    • Smart Teams

    • Dedicated Teams
    • Offshore Development Centre
    • Enterprise Services

    • Technology Consulting
    • Robotic Process Automation
    • Legacy Modernization
    • Enterprise Mobility
    • ECM Solutions
  • Who We Serve
    • By Industry

    • Healthcare
    • Software & Technology
    • Finance
    • Banking
    • Real Estate
    • Travel & Transportation
    • Public Sector
    • Media & Entertainment
    • By Role

    • CEO / Business executives
    • CTO / IT professionals
    • COO / Operations
  • Our Expertise
    • Mobility
    • UI/UX Design
    • Blockchain
    • DevOps
    • Artificial Intelligence
    • Data Enrichment
    • Digital Transformation
    • Internet of Things
    • Digital Commerce
    • OTT Platforms
    • eLearning Solutions
    • Salesforce
    • Business Intelligence
    • Managed IT Services
    • AWS Services
    • Application Security
    • Digital Marketing
  • Case Studies
  • Discover Daffodil
    • About us
    • Partnership
    • Career & Culture
    • Case Studies
    • Leadership
    • Resources
    • Insights Blog
    • Corporate Social Responsibility
Get in Touch
blog header image.png

Software Engineering Insights

How to Make Use of App::Make() In Laravel 4 for Rendering Views

Feb 18, 2015 3:14:46 PM

  • Tweet

Getting stuff done with Laravel 4 using the App::make() method is extremely safe and rather a better approach to decouple dependencies from each other. While you type hint a dependency in the constructor method, the Laravel framework automatically injects dependencies by reading the type of its dependent object while using App::make() behind the scene.

Problem - How to call a controller in Laravel 4 view blade file

While working on an application in Laravel 4, we were facing a problem in rendering one view from another view and also within that view. Each view is containing different data to show and the view should be rendered without page reload.

Solution Proposed By Daffodil Team

We implemented App::make() method in laravel which turned out to be very useful. On calling App::make() method, the Closure callback is executed and the result is returned.

Let me illustrate this using an example

Suppose you have a view blade say "one.blade.php" and you have bootstrap tabs. Every time the tab is clicked, you want to render same/different view with different data without reloading the page.
Shared below is the code that we used to solve the problem -

In the file one.blade.php, insert the code -

 

[php]<ul class="nav nav-tabs" id="nav-tabs" role="tablist">
<li class="active"><a href="#newdata"> NewData </a></li>
</ul>[/php]


 

[php]<div class="tab-pane active" id="newdata">

</div>[/php]


Now at the time when one.blade.php got rendered, at the same time App::make() under the NewData tab gets executed and result is returned in a string format. Now we just have to echo it to render the view with different data.

Similarly, you can also try the solution to implement App::make() manually for rendering a view within that view.

In your controller (Your_controller_name), you have to create a function by the name getData, like
public function getData () {

}
and do whatever calculations you want to do. At the end you can insert the
return View::make() code to render a view file with data in the portion of that tab onto the one.blade.php.

The view will render without having any route and without reloading the page.

One can also include view using @include() method also. Although this method is different from App::make() as with App::make(), we can render the same view with different data which is otherwise not possible with @include() method.

We hope you enjoyed reading the blog!!

Happy coding!!

Topics: Web Development

Team Daffodil

Written by Team Daffodil

We equip smart companies with smarter solutions. Our all-round expertise in Web, Mobile and Cloud solutions has brought about a change in some of the top businesses, setting global milestones as we go.

[fa icon="facebook-square"] [fa icon="linkedin-square"] [fa icon="twitter-square"]

Previous Post

previous_post_featured_image

Test Driven Development - How Can it Benefit Your Business In Ensuring Software Quality?

Next Post

next_post_featured_image

Exploring Material UI - The New Design Language For Android

Stay Ahead of the Curve with Our Weekly Tech Insights

  • Recent
  • Popular
  • Categories

Lists by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all

Posts by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all topics

Elevate Your Software Project, Let's Talk Now

Awards & Accolades

dj
dj
dj
dj
dj
Aws-certification-logo
microsoft-partner-2-1
microsoft-partner
google-cloud-partne
e-UI-Path-Partner-logo
partner-salesforce-reg-consulting-partner-1-1
daffodil-logo
info@daffodilsw.com
  • Home
  • About Daffodil
  • Locations
  • Privacy Policy
  • Careers

© 2025 Daffodil Unthinkable Software Corp. All Rights Reserved.