Results 1 to 9 of 9

Thread: Configure extjs app to load from laravel

  1. #1
    Sencha Premium User
    Join Date
    Jul 2014
    Posts
    269
    Answers
    15

    Default Answered: Configure extjs app to load from laravel

    I created an ExtJS app called MyApp with cmd that I put in the public directory of a Laravel project.

    In the Laravel views folder I created a view named index.blade.php containing the index.html code of the ExtJS app with the following change:

    HTML Code:
      <script id="microloader" data-app="abcd123…etc." type="text/javascript" src="{{ URL::to('MyApp/bootstrap.js') }}"></script>
    Loads the bootstrap.js file, but does not load the extjs app and returns the 404 (Not Found) error by not loading the classic.json file.

    Is there any change to be made in the extjs app settings to allow the extjs app to load from laravel?

  2. Yes in a way. You want to put the files and folders from your production build (sencha app build --production). The files from /build/production/MyApp/.
    So for your development environment you put all the files and folders in /public like you already did but in production you want to put the production build files in /public

  3. #2
    Sencha Premium Member
    Join Date
    Dec 2012
    Location
    Seattle, WA
    Posts
    424
    Answers
    34

    Default

    Your production build needs to be in in the public folder

  4. #3
    Sencha Premium User
    Join Date
    Jul 2014
    Posts
    269
    Answers
    15

    Default

    Thanks for help MikeRH.
    The extjs app generated with cmd is in public folder
    + public
    ++MyApp (ExtJS)

    After many attempts I begin to think that it is not possible to load the extjs app from a view blade (index.blade.php). Have you ever succeeded in this type of approach?

  5. #4
    Sencha Premium User
    Join Date
    Jul 2014
    Posts
    269
    Answers
    15

    Default

    Quote Originally Posted by MikeRH View Post
    Your production build needs to be in in the public folder
    I put all the extjs app files and folders directly inside the public folder (without being inside the MyApp folder) and it works.
    Apparently this is the only way to get the extjs app loaded.
    This is what you suggested, right?

  6. #5
    Sencha Premium Member
    Join Date
    Dec 2012
    Location
    Seattle, WA
    Posts
    424
    Answers
    34

    Default

    Yes in a way. You want to put the files and folders from your production build (sencha app build --production). The files from /build/production/MyApp/.
    So for your development environment you put all the files and folders in /public like you already did but in production you want to put the production build files in /public

  7. #6
    Sencha Premium User
    Join Date
    Jul 2014
    Posts
    269
    Answers
    15

    Default

    Quote Originally Posted by MikeRH View Post
    Yes in a way. You want to put the files and folders from your production build (sencha app build --production). The files from /build/production/MyApp/.
    So for your development environment you put all the files and folders in /public like you already did but in production you want to put the production build files in /public
    Thanks MikeRH.

  8. #7
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    898
    Answers
    15

    Default

    Maybe can help you

    index.blade.php

    Code:
     @if (App::environment() === 'production')
            <base href="/build/production/MyApp/"/>
        @elseif(App::environment() === 'testing')
            <base href="/build/testing/MyApp/"/>
    
    
        @elseif (App::environment() === 'local')
            <base href="/MyApp/"/>
        @endif
    
    
     @if (App::environment() === 'production')
            <script id="microloader" type="text/javascript" src="microloader.js"></script>
        @elseif (App::environment() === 'local')
    
    
            <script id="microloader" type="text/javascript" src="bootstrap.js"></script>
    
    
        @elseif (App::environment() === 'testing')
            <script id="microloader" type="text/javascript" src="microloader.js"></script>
    
    
        @endif
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  9. #8
    Sencha Premium User
    Join Date
    Jul 2014
    Posts
    269
    Answers
    15

    Default

    Thanks wemerson.januario. This helps.

  10. #9
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    898
    Answers
    15

    Default

    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

Similar Threads

  1. Build ExtJS app in Laravel structure
    By miikes in forum Ext 5: Q&A
    Replies: 5
    Last Post: 20 Jun 2016, 4:39 AM
  2. How to configure ViewModel to load just one record?
    By marc.fearby in forum Sencha Architect 3.x: Q&A
    Replies: 2
    Last Post: 28 Jun 2015, 2:35 PM
  3. Replies: 2
    Last Post: 20 Sep 2014, 1:58 PM
  4. Replies: 1
    Last Post: 21 Dec 2011, 8:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •