Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 191-200 of 322 result(s).

Extending CJuiDialog

Created 2 years ago by dstudioHow-tos0 comments – viewed 8,871 times – ( +2 / -2 ) – version 1.1
Sometimes you have CJuiDialog with different content but same buttons (or width, height). If you don't want to repeat yourself this is a great solution:

Using Pear Mail Mail_Mime and Mail_Queue

Created 3 years ago by LorenHow-tos2 comments – viewed 8,826 times – ( +7 ) – version 1.1
Create a component (/protected/components/PearMail.php) Edit this as needed based on where you put the files from PEAR.

Creating a Dependent Dropdown From Scratch in Yii2

Created 6 months ago by ThePr0f3550rHow-tos1 comment – viewed 8,808 times – ( +4 ) – version 2.0
I have read http://www.yiiframework.com/wiki/24/creating-a-dependent-dropdown/ (Dependen Dropdown Yii1), but I cant implementation in Yii2 because Yii2 not built-in AJAX functionality hem.. I am search about it and get this statement

Limit a CGridView field to some preset length.

Created about a year ago by le_topHow-tos1 comment – viewed 8,747 times – ( +13 ) – version 1.1
Sometimes text inside a gridview column is just too long. That's why I figured out a way to make the column smaller while still providing the information.

How to create Module based Login

Created 11 months ago by turiHow-tos1 comment – viewed 8,713 times – ( +3 ) – version 1.1
Lets say we have 3 modules (customer, user, admin) in an application and we need, separate logins for each module.

Yet another implementation of CPhpAuthManager.

Created about a year ago by seenivasanHow-tos3 comments – viewed 8,700 times – ( +8 / -1 ) – version 1.1
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at main application level to controller level. This way we have pulverised auth data for entire site into smaller units. Finally we are going to look at couple of examples.

ISA hierarchy of tables inside a database and how to implement a single form

Created 3 years ago by pligorHow-tos2 comments – viewed 8,533 times – ( +1 ) – version 1.1
Please consider the following Dear software engineers imagine I have a simple ISA hierarchy: parent A with children B and C. So let's say we have the corresponding tables named "a", "b", "c" and (created with the help of the gii model creator) the classes A, B, C The following is a screenshot from MySQL workbench:

Using the jamselect widget with min and max values

Created 4 years ago by got 2 doodleHow-tos0 comments – viewed 8,456 times – ( +2 ) – version 1.1
I needed to have users select from a list of keywords, in this example they must select at least two keywords but they cannot select more than six.

Simple Web APIs for your Yii App

Created 11 months ago by shivHow-tos4 comments – viewed 8,346 times – ( +2 / -2 ) – version 1.1
Its very common now-a-days to have Mobile app for web apps. For Mobile apps we need web APIs to fetch data or even post/update on web. We found a very simple method to make such interface. Mobile App can call plain get or post request and receive data back in JSON format. JSON is relatively easy for mobile app to handle while plain standard GET/POST request for easy for Web server to handle. This mixed approach saves lot of time on server side. We not really need to handle actual REST requests and still be able to exchange data between web and mobiles or ajax java-scripts or even node.js.
tags: API, JSON

Upload files in Yii2 with MongoDb and GridFs

Created 10 months ago by edoardo849How-tos3 comments – viewed 8,331 times – ( +7 ) – version 2.0
Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).