Showing 61-80 of 652 items.

Use different environments (development, production, etc) in your app with EASY Environment Class

Created 16 years ago by nancoder nancoder, updated 15 years ago by marcovtwout marcovtwout. 6 comments

Hi, I was having problems each time I had to test the site or edit something on my local machine, like changing the db connection, change the debug mode to false, the trace level to 0, disable Gii, etc. So I created a class to resolve all my problems, hope to help you in your projects!

7 0
7
Viewed: 87 433 times
Version: 1.1
Category: Tutorials

    URL component access functions

    Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 1 comment

    Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.

    28 0
    16
    Viewed: 23 514 times
    Version: 1.1
    Category: Tips

    CGridView and AjaxForm Connect

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

    <?php $this->widget('zii.widgets.grid.CGridView', array(

    'dataProvider' => $dataprovider,
    'id'=>'recipient_table',
        'selectionChanged'=>'updateEditForm',
    'columns' => array(
    	'rec_id',
                'org.nachname',
                'org.vorname',
                'org_id',
                array(
                    'class'=>'CButtonColumn',
                    'template'=>'{...
    
    1 0
    10
    Viewed: 31 608 times
    Version: 1.1
    Category: How-tos

    Named scope - Get orphan AR without losing primary key

    Created 16 years ago by cma cma, updated 15 years ago by Steve Friedl Steve Friedl. 0 comments

    Sometime, in a many-to-many relation, you need to retrieve AR that aren't linked. In practice, AR with null value in the join table. So you implements a criteria like this :

    public function scopeUnused( $useAnd = true )
        {
            $join = " left outer join composed_by j on t.ID = j.ID ";
            $condition = ' j.ID Is Null';
    
    
    0 0
    2
    Viewed: 12 443 times
    Version: 1.1
    Category: Tutorials