Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are 4 different ways to do this:</p> <ol> <li><p>Add the configuration to the app's configuration (<em>protected/config/main.php</em>):</p> <pre><code>'modules'=&gt;array( 'admin'=&gt;array( 'preload'=&gt;array('bootstrap'), 'components'=&gt;array( 'bootstrap'=&gt;array( 'class'=&gt;'ext.bootstrap.components.Bootstrap' ) ), // ... other modules ... ) </code></pre></li> <li><p>Preload it in the <code>init</code> :</p> <pre><code>public function init() { // import the module-level models and components $this-&gt;setImport(array( 'admin.models.*', 'admin.components.*', // 'ext.bootstrap.components.Bootstrap', // this will go to app config for components )); Yii::app()-&gt;getComponent('bootstrap');// this does the loading } </code></pre></li> <li><p>Preload in <code>init</code> another way:</p> <pre><code>public function init() { // import the module-level models and components $this-&gt;setImport(array( 'admin.models.*', 'admin.components.*', )); $this-&gt;configure(array( 'components'=&gt;array( 'bootstrap'=&gt;array( 'class'=&gt;'ext.bootstrap.components.Bootstrap' ) ) )); $this-&gt;getComponent('bootstrap'); } </code></pre></li> <li><p>Preload in <code>init</code> yet another way:</p> <pre><code>public function init() { // import the module-level models and components $this-&gt;setImport(array( 'admin.models.*', 'admin.components.*', )); $this-&gt;configure(array( 'preload'=&gt;array('bootstrap'), 'components'=&gt;array( 'bootstrap'=&gt;array( 'class'=&gt;'ext.bootstrap.components.Bootstrap' ) ) )); $this-&gt;preloadComponents(); } </code></pre></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload