Copy a project from one directory to another directory - YII2 basic - css

I have created one project in yii2-basic. In that I had done the some changes in the bootstrap.css in the web/assets/dir/.
Now I need to deploy this into another directory. I copied that project into another directory. Then I run in the browser. The changes I had done in the files are not affecting to the site. Then it refers to the another file for css.
I can't find the correct way to do this. Can anyone show me the correct way to do this?

for changing the css you should change the original in the
.\basic\vendor\bower\bootstrap\dist\css
then minimize it
and then in the dir web\asset you must delete the dir where is place the bootstrap (bootstrap-min.css i guess) files
There isn't a fixed name for this asset dir, you must find yourself the correspondent dir containing all the bootstrap part (css, js , fonts). and then remove (cancel) this dir.
Removing this dir when you accessing to the app the dir is newly recreate (normally with another asset id name).
If you don't do this when you copy a project in a new dir, at the first access the asset directory are newly create and the code you have change is not reached by application.

Related

Issues with files naming when useing filerev & usemin

Lets assume I have 2 static assets (html files) in my project, files a.html and b.html.
File a.html has a link to file b.html inside of it.
Now I run a build and the 2 files got their name changed and everything is working fine (by the filerev module).
Now I need to make a small change only in file b.html -> filerev will give a new name to file b.html in the next build. Because file a was not changed it will have the same name as the prev build.
Now, in the next build usemin will go to file a and will fix the link to the new file b name and everything looks fine. But not, because file a still has the same name as prev build, users will get a broken link when trying to access file b from a.
I guess a workaround is to instead of having hashes of the file names, generate random file names each time.
That way you are generating all files so it is not optimized, but you prevent the caching problems between versions, while still allow caching of the browser for the same version.
Using the grunt-angular-template task can solve this issue as it is adding all the templates to the $templateCache of angular, so the no real requests will be made to the server when a template is requested and the recent template is loaded from the cache. Of course it is not ideal as in big applications you will not want this as this may increase your js file size

Keep CSS Formatting in folder assets Yii

I used yiibooster I have changed many styles under /assets/73dd67/bootstrap/css/bootstrap-min.css
But when I changed my webapp name, the CSS files not found, I mean the folder '73dd67' changed to '253ft6'.
The same case when I moved my webapp to another computer. The '73dd67' folder changed again in another name.
What can I do so I can keep the CSS formatting?
Thanks for your answers
Asset folder have only cached files. You made changes in cached file not actual file.
So find the actual location of bootstrap-min.css and do your changes. After doing changes, just remove all cache folders inside the asset folder. Then you can see the output in next refresh itself.
Hope you are using yIIbooster as extension. So do your changes in extension css/bootstrap-min.css file.

Bluimp Backload folder reference issue with virtual directories

I am working on a solution which has two projects in it. One is a virtual app which works in another. The first application is the panel and the second is the website. First application can be accessed with "localhost:10001/panel" and the second with "localhost:10001". You see, I created a virtual path for the first app to work under the second one in Visual Studio and they work great that way.
The problem I am having now is about the file uplaod system, "Blueimp's jQuery-File-Upload" plugin and as backend using "Backload". I must say that these work great on a standalone project. That's why I decided to continue the project using these.
But when it comes to a setup which I explained below, I cannot access the files I upload. I installed fileupload system in the panel project, which is accessed as "localhost:10001/panel" so when I leave the default web.config configuration for backload (default is "~/files"), all files are uploaded to the "localhost:10001/panel/files" path. And after the upload when I refresh the page, all uploaded file links are referencing "localhost:10001/files/" without the "panel" folder.
In BackLoad web.config notes how to change and use root upload folders are explained like that
filesRoot: // Root upload folder. If the value starts with '~/' (e.g. ~/files) the path is relative to the web root, otherwise set an absolute local path (e.g. d:/files) [Default: "~/Files"].
I understand that having "~/" at the beggining of a folder reference shows the project's root. But I can't figure out how to reference the upload folder, instead of the default "~/files", to upload and access all files from the second project's root. When I need to reference folder between these two projects I simple use "../", or "/" to access the second project's (site) root. But doing that in "filesRoot" attribute of BackLoad config settings, all file references are starting "///file....." and shows a local path in the computer.
I simply want to upload and access the files from the "localhost:10001/files" location when I upload files from the panel. Now, I cannot even use the "localhost:10001/panel/files" path because files are uploaded to "panel/files" folder, but are accessed from "files" folder with default settings.
BTW: I am using BackLoad's WebForms Example on this project, and this is a Web Forms project.
I ended up using Files folder as a temp folder. At the time of submit, I move the file which is uploaded in Files folder, to the folder of my need. And the problem is solved.
Thanks anyway...

Xcode static library appears twice

I added the OCMock static library in Xcode with some header files.
I'm not sure what's changed since I added it but the file now appears twice in the Project Navigator - once at the top level and once under the usr/lib folders.
How do I get rid of the second (highlighted) listing?
It looks like you added OCMock's whole "usr" folder via a folder reference, most likely by accident.
You have three choices for a solution:
1)
Remove the "usr" folder from your list of files & folders in your project, and re-add just the "include" folder via folder reference (I'm presuming you want to use the folder reference so you can pick up the latest header files that are in there?).
2)
Add the required header files to your project directly (i.e. not using the folder reference).
3)
Or get rid of the first "libOCMock.a" library and just rely on the folder reference to pick up the static library living under the "usr" hierarchy.

Xcode 4 project template adds extra folder

When I make a new project with xc4 I don't want it to create a folder with the same name as the project. I want the source files associated with a project template to get copied into several other folders that sit next to the project.
In the TemplateInfo.plist, I can specify which files to copy through the Definitions and Nodes arrays. In the Definitions, if I make the name ../Example.cpp then it will copy the file into the directory with the project rather than into the folder that has the project's name, which is what I want. But, if i delete that empty folder then xcode can no longer find any files because all files had to be specified relative to the auto-created folder.
Does anyone know how to get around this? Is there some way to specify which folder project files should be relative to? Or perhaps some other way to specify relative paths for files in a project template?

Resources