This question already has answers here:
Preventing a specific CSS file from getting loaded in Yii
(2 answers)
Closed 9 years ago.
hi i'm running a site on YII. which has two module user and admin.
but my config file has bootstrap pre load including responsive css. I want responsive feature for user module only.
i don't want responsive CSS to load in my admin module. is there any way i can unload it only for admin module by doing something on admin layout file?
i have tried
$responsiveCss = false
but it turns off responsive feature for the whole site.
i want it only for admin module.
thanks
Do like this on protected/config/main.php,
'components' => array(
'bootstrap' => array(
'class' => 'ext.bootstrap.components.Bootstrap',
'responsiveCss' => !(isset(Yii::app()->controller->module->id) and (Yii::app()->controller->module->id == 'admin' )),
),
---
),
It will make responsive css to all other expert 'admin' module.
Related
guys. I'm working on a modular admin system, based on Codeigniter 4 (as backend) and Vue.JS as frontend.
The main requirement for Codeigniter is that the system be completely modular, that is, by deleting a folder – you can remove, say, blog (news) management, or vice versa - add a file module and manage files (let's say – it's plugins, a bit like wordpress).
The main problem is that I want to make a SPA (single page app), and vue router requires a list of routes when it's init. At the login stage, I know that there are only standard (mandatory) pages: login, forgot (password reset), dashboard, settings (user settings). The backend will show other plugins only after successful authorization (example): news, pages manager, items (manage shop items) etc. And each of them can have several more routes for managing inside: create (add new record to database), edit, delete, view (card of record).
Is it possible to implement this with Vue router so that we get a SPA? Or can SPA be implemented only with a static (when it is clear how many pages there will be) project?
For better understanding, my plugins have all the necessary structure and are completely independent. Previously, when I didn’t use the Vue.js router, PHP went through all the plugin folders and collected a link (it creates array with links and at the header template I go through this array) to them for the menu , let's say from a file menu.php, in which was link (for example only):
<?php
$menu['main'][] = array(
'type' => 'item', // item or sub-item for menu
'link' => MODULES_URL.'pages/items', // link to main page of plugin (by default list of records for this plugin)
'title' => 'Pages Manager', // name of page
'active' => ($this->uri->segment(3) == 'pages'), // is active link? for menu
'icon' => 'fa fa-pencil-square' // icon for menu
);
?>
I got some code of Laravel where confide (https://github.com/Zizaco/confide) is used. Now I would like to add CSS in these Web Pages of Laravel.
Can anyone say how can I do that ??
Unless I am mistaken I'm pretty sure the question the poster was trying to ask is how to style the forms that reside outside of the app\viewsfolder. The forms confide uses by default are in the \vendor\zizaco\confide\src\views folder.
You can change the default forms and use custom ones by editing the config.php and style them like any other view.
Change this
*\vendor\zizaco\confide\src\config\config.php
'login_form' => 'confide::login',
'signup_form' => 'confide::signup',
'forgot_password_form' => 'confide::forgot_password',
'reset_password_form' => 'confide::reset_password',
To this
*\vendor\zizaco\confide\src\config\config.php
'login_form' => 'user.login',
'signup_form' => 'user.register',
'forgot_password_form' => 'user.password',
'reset_password_form' => 'user.reset',
I think you misunderstood what confide is or how laravel works.
Confide is a package to manage the authentication process in your website it has nothing to do with the front-end design of your website. It serves the back end operations to authenticate a model.
You must first pass the model through a controller and in to a view.
After that you can use blade templating to present the models and their attributes
and you can use whatever styling you want in your views.
Those are basic principles of the MVC design pattern if you don't understand what I'm trying to explain to you should read the laravel documentation
So I want my yii framework application to have its User control handling the login and all of that inside a folder named Backoffice.I haven't tried this yet because I know I will brake the website.
So my question is how to tell yii that the files are located under different directories
You can set a path in config/main file. For example
'yiiPath' => dirname (FILE). '/../../framework/yii.php',
or
'import' => array(
'application.models.',
'application.components.',
'application.modules.user.models.',
'application.components.',
'application.modules.role.models.',
'application.modules.profile.models.',
'packages.solr.',
'application.modules.registration.models.',
),
I have installed YiiBooster and am using the latest Yii v1.1.13. My main.php file contains the following configuration:
'preload'=>array('log','bootstrap'),
// application components
'components'=>array(
'bootstrap'=>array(
'class'=>'ext.bootstrap.components.Bootstrap',
'responsiveCss'=>true,
),
'user'=>array(
'class'=>'RWebUser',
// enable cookie-based authentication
'allowAutoLogin'=>true,
'loginUrl'=> array('/user/login'),
),
...
However, after doing this none, of the YiiBooster widgets are displaying properly. As a new user I am not able to post images; however, my datepickerRow() widget looks just like the one in this post: Yii Booster datepicker not working correctly. The 'look' of the widget is not normal.
I have a number of other problems with other widgets. The bigger problem is the TbExtendedGridView that is not showing any of the View/Edit/Delete icons. Actually none of my 'prepend' icons are working on the forms either. Any ideas?
As requested - here is an example of a widget not working correctly. None of the little icons for view/edit/delete are shown. Also the row striping is not working, and the column title bar is a strange color.
$this->widget('bootstrap.widgets.TbExtendedGridView', array(
'dataProvider'=>$dataProvider,
'type'=>'striped',
'columns'=>array(
'Registration',
'WONumber',
'InspectionType',
'LogEntryDate',
),
));
I am also having trouble with a textfieldRow() control. So I don't believe this is a problem with widgets, I think it is something to do with the way I have YiiBooster configured.
UPDATE - Still Not Working
I have found that the file in conflict with the CSS is the /var/www/intranet/css/screen.css file. When I remove this file from my main.php layout file, the CSS from YiiBooster works properly. The problem is that the rest of the page looks terrible.
So, I'm still researching why I can't run blueprint CSS and YiiBooster at the same time. Any help would be appreciated.
UPDATE - SOLVED
I found that other people were having trouble running the stock Yii blueprint CSS setup, so I switched completely over to YiiBooster and have not had any problems. I removed the CSS links in my main.php layout file. After converting all of the Yii widgets to YiiBooster widgets, everything works great.
You need to add the following to your grid as an element of the columns array:
array(
'class'=>'bootstrap.widgets.TbButtonColumn',
'htmlOptions'=>array('style'=>'width: 50px'),
),
I am working with Yii Jui widgets to have JuiTabs in a website. The problem is when the site is loading I first see the list (without any css) and then after the page loads the tabs show as they should. I wonder if there is a way to preload JuiTabs somehow so they show correctly when the page is loading.
Here is my code:
<?php
$this->widget('zii.widgets.jui.CJuiTabs', array(
'tabs'=>array(
'PRESENTAZIONE'=>array('content'=>$this->renderPartial('spettacoli/_view_presentazione', array('model'=>$model),$this)),
...
),
'options'=>array(
'collapsible'=>false,
),
));
?>
And here is the example of the page. The problem is visible when the internet connection is slow, and it takes time until the page loads
Not sure that's possible to preload JuiTabs somehow, but you can add display: none for CJuiTabs by default and show that with JS on page load. Not the best way, but first idea came into my mind.