1

I am using Kickstrap 1.3.0 and want to add an App in my PHP-View with a method like <?php $this->enableKickstrapApp('myapp'); ?>. This method would put the app name into an apps array and the layout template could generate any code anywhere in the page to active the app.

But I don't know how to load the app. The docs say that I should add a page specific less file. But I don't want to autogenerate such an extra less file (I will do this it there is no better solution). Also an API method loadApp() is mentioned in the API docs. But there seems to be no loadApp in the source code. Also it is not documented how to get the API object (maybe this should be a global method--I couldn't find it). In an maybe outdated doc at GitHub I found the tip to write a pageApps array. But scanning the source code for "pageApps" also had no results.

Is there any way to activate an app dynamically (or in the global ks variable) without an extra less file?

Adam Grant
  • 12,477
  • 10
  • 58
  • 65
stofl
  • 2,950
  • 6
  • 35
  • 48

1 Answers1

1

That works:

var ks = {
    apps: ['myapp']
}

Must be defined before loading kickstrap.js of course.

stofl
  • 2,950
  • 6
  • 35
  • 48
  • 1
    To add on to this, there is no API object in 1.x but there is a ks object which I am trying to get more things namespaced into. Case in point, @stofl's answer shows how to define your apps as a property of the ks object. Please also note this will add on to any apps you've defined in kickstrap.less – Adam Grant Jan 29 '13 at 22:39
  • I'm not leet enough to add a "kickstrap" tag to this question, anyone out there brave enough to do it please? – Adam Grant Jan 29 '13 at 22:40