Showing 701-720 of 826 items.

embed a view file of the class which implement the CAction.

Created 15 years ago by Davidhhuan Davidhhuan, updated 15 years ago by Davidhhuan Davidhhuan. 1 comment

In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...

1 1
2
Viewed: 29 187 times
Version: 1.1
Category: Tutorials

Setting and getting systemwide static parameters

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 3 comments

Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.

11 0
12
Viewed: 153 044 times
Version: 1.1
Category: How-tos

Putting Function To Be Called In View

Created 15 years ago by junxiong junxiong, updated 15 years ago by junxiong junxiong. 2 comments

Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:

5 1
5
Viewed: 55 275 times
Version: 1.1
Category: Tips

Auto TDD - How to auto-run PHPUnit

Created 15 years ago by imehesz imehesz, updated 15 years ago by imehesz imehesz. 3 comments

If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!

3 0
6
Viewed: 22 978 times
Version: 1.1
Category: Tips

Multiple-database support in Yii

Created 15 years ago by Steve Friedl Steve Friedl, updated 14 years ago by phazei phazei. 18 comments

The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.

20 0
39
Viewed: 154 707 times
Version: 1.1
Category: How-tos

Increasing AR performance in connections with Oracle

Created 15 years ago by Trejder Trejder, updated 14 years ago by igorsantos07 igorsantos07. 14 comments

Please, note. This article is entirely based on a work done by me colleague developer, who hasn't got account on this webpage and also hasn't got time for writing this article. I'm writing it for him. I will try to forward him any comments that may appear, but can't assure if/when he'll be able to answer. I'm far, far less experienced in Oracle therefore I won't probably be able to help myself.

1 0
15
Viewed: 62 107 times
Version: 1.1
Category: How-tos

Using standard filters in CGridView custom fields

Created 15 years ago by GOsha GOsha, updated 15 years ago by jwerner jwerner. 4 comments

In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0.
So we do the usual thing:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16
Viewed: 79 022 times
Version: 1.1
Category: How-tos

Moving project code outside of webroot (plus multiple project support)

Created 15 years ago by Steve Friedl Steve Friedl, updated 14 years ago by Steve Friedl Steve Friedl. 8 comments

Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).

21 1
19
Viewed: 71 026 times
Version: 1.1
Category: How-tos

"Why do I get a 403 error when trying to use Gii?"

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 3 comments

After enabling the Gii module in your protected/config/main.php file and then try to use it with http://example.com/index.php?r=gii, you get an error: ~~~ Error 403 You are not allowed to access this page. ~~~ This is almost certainly caused by the IP filtering mechanism that Gii uses to protect your system from outsiders - by default it allows localhost only (both IPv4 and IPv6), and r...

6 0
5
Viewed: 93 452 times
Version: 1.1
Category: FAQs

How to log and debug variables using CWebLogRoute

Created 15 years ago by Antonio Ramirez Antonio Ramirez, updated 15 years ago by Antonio Ramirez Antonio Ramirez. 8 comments

Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...

13 0
20
Viewed: 82 404 times
Version: 1.1
Category: How-tos