Yii...header already send Problem

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Atkaz, 11. April 2012 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 11. April 2012
    Hallo Leute, ich habe ein Problem mit Yii. Vielleicht arbeitet ja jemand von euch mit dem Framework und kann mir da weiter helfen.

    Es geht darum, dass ich beim aufrufen des Yii::app()->request->getCsrfToken() eine Fehlermeldung : Cannot modify header information – headers already sent...der und der zeiger steht auf Yii::app()->request->getCsrfToken()...bekomme.

    Ich habe eine Dash-Navigation erstellt, wo ich buttons mit unterschiedlichen Funktionen definieren kann. eineige davon senden auch Daten mit ajax zum Server. Das ich die csrfValidation auf true gesetzt habe, muss ich ja auch den csrfToken mit schicken..und da kommt es zum Problem.

    Ich habe für häufig verwendete Buttons DefaultCommands definiert diese werden in einem seperatem Behavior geladen. Dort habe ich auch die Funktion _validateCsrfData-->Hängt den Tocken an die ajax->data dran. Und wie oben bereits erwähnt tritt dabei der o.g. Fehler auf.

    Ich solte nochmal erwähnen, dass die Navi im Adminbereich genutzt wird und ich dafür einen eigenen Controller(AController) habe sowie eine eigenes Theme was ich im AController mit setTheme() definiere.


    wie es aussieht liegt es am DataProvider den ich vom CActiveDataProvider abgeleitet habe. Der Code sieht wie folgt aus:


    PHP:
    <? php
    class  RNestedDataProvider  extends  CActiveDataProvider
    {
        

        
    private  $_authorizer ;
        
        

        
    public function  __construct ( $userClass , $config =array())
        {
            
            
            
    $module  Rights :: module ();  // Das Rights Modul
            
    $userClass  $module -> userClass ;
            
    parent :: __construct ( $userClass $config );
            
            
    $this -> _authorizer  $module -> getAuthorizer ();
        
            
        }
        
        

        
    protected function  fetchData ()
        {
                
    $data  parent :: fetchData ();
            
            foreach( 
    $data  as  $model  )
                
    $this -> _authorizer -> attachUserBehavior ( $model );
            
            return 
    $data ;
        }
    }
    ?>




     
  2. 11. April 2012
    AW: Yii...header already send Problem

    ob_start() oder in der php.ini nen buffer anmachen oder deinen code aufräumen.

    das problem: du hast bereits sachen ausgegeben (echo/print oder html include)
     
  3. 11. April 2012
    AW: Yii...header already send Problem

    Ich kenn mich mit Yii nicht aus, aber wenn es heist "headers already sent" dann heist das doch einfach nur irgendwi ging schon ne ausgabe raus, wie murdoc schon sagte.

    Etwas anderes kann es ja nicht sein, der Fehler bezieht sich meiner Erfahrung nach wirklich nur auf die Tatsache der Ausgabe.

    Vieleicht mal suchen wo etwas schon raus ist?
     
  4. 11. April 2012
    AW: Yii...header already send Problem

    Hmm..ich habe.echt schon alles durch gecheckt..und i-wie finde keine ausgaben...wenn ich mir die Daten vom CActiveDataProvider hole funktioniert es...
     
  5. 11. April 2012
    AW: Yii...header already send Problem

    Füge die folgenden Zeile in deine index.php vor $app->run(); ein und gib uns die Ausgabe bei dem Fehler:

    PHP:
    // remove the following lines when in production mode
    defined ( 'YII_DEBUG' ) or  define ( 'YII_DEBUG' true );

    // specify how many levels of call stack should be shown in each log message
    defined ( 'YII_TRACE_LEVEL' ) or  define ( 'YII_TRACE_LEVEL' 3 );
     
  6. 11. April 2012
    AW: Yii...header already send Problem

    auch ohne stack müsste man doch in der fehlermeldung sehen können wo der erste output passiert ist.

    da steht doch sowas wie "output started at ... line ..."
     
  7. 11. April 2012
    AW: Yii...header already send Problem

    die aktuelle Fehlermeldung:

    PHP:
    Cannot modify header information  headers already sent by  ( output started at  / homepages / 20 / d327830284 / htdocs / app /protected/ modules / rights / components / dataproviders / RNestedDataProvider . php : 46
    index.php

    PHP:
    <? php
    // change the following paths if necessary
    $yii = dirname ( __FILE__ ). '/../framework/yii.php' ;
    $config = dirname ( __FILE__ ). '/protected/config/' ;

    // remove the following lines when in production mode
    defined ( 'YII_DEBUG' ) or  define ( 'YII_DEBUG' , true );
    // specify how many levels of call stack should be shown in each log message
    defined ( 'YII_TRACE_LEVEL' ) or  define ( 'YII_TRACE_LEVEL' , 3 );


    if( 
    YII_DEBUG  ===  true  )
    {
        
    ini_set ( 'display_errors' true );
        
    error_reporting ( E_ALL );
    }
    else
    {
        
    ini_set ( 'display_errors' false );
        
    error_reporting ( 0 );
    }

    $configFile  YII_DEBUG  'dev.php'  'production.php' ;


    require_once(
    $yii );

    Yii :: createWebApplication ( $config . $configFile )-> run ();



    Funktion die beim Request aufgerufen wird

    PHP:

    public function  actionIndex ( $type = null , $pid = null )
        {
            
    // Type wird geprueft
            
    $type  =( $type  != null  &&  Rights :: getValidChildTypes ( $type ))? $type : 2 ;
            
    $condition = '' ;
            
    // Parent angegeben??
            
    if( $pid  != null )
            {
                
    $parent  $this -> loadModel ( $pid );
                
    $condition  " AND lft>" . $parent -> lft . " AND rgt<" . $parent -> rgt ;
            }
            
            
    $dataProvider =new  RNestedDataProvider ( 'Items' ,array(
                 
    'criteria' =>array(
                    
    'condition' => 'type=' . $type . $condition // Nur Rollen
                    
    'order' => 'lft ASC' ,
                    ),
            ));
            
            
    $this -> render ( 'index' ,array(
                
    'dataProvider' => $dataProvider ,
                
    'type' => $type
            
    ));
        }


    die Index View

    PHP:
    <? php

        $this
    -> dash =array(
                
    "title" => "Zugriffsverwaltung- " . Rights :: getAuthItemTypeNamePlural ( $type ),
                
    'titleImage' => 'rights_mgt.png' ,
                
    'checkBox'  =>  "right_item_ckbx" ,
                
    'gridId'  =>  "roles-grid-id" ,
                
    'checkName' => "roles[]" ,

                
    "buttons" =>array(
                            
    "create" =>array( "url" => Yii :: app ()-> controller -> createUrl ( "admin/create" ,
                                            array(
    "type" => $type ))),
                            
    "edit" =>array( "url" => Yii :: app ()-> controller -> createUrl ( "admin/update" )),
                            
    "delete" =>array( "url" => Yii :: app ()-> controller -> createUrl ( "delete" ),
                                            
    "ajax" =>array(
                                                    
    "data" =>array( Yii :: app ()-> request -> csrfTokenName  =>
                                                                        
    Yii :: app ()-> request -> csrfToken ))
                                            ),
                            
    "cancel" =>array( "url" => Yii :: app ()-> controller -> createUrl ( "admin/index" )),
                            ),
                
    'menu' =>array( "Roles" => Yii :: app ()-> controller -> createUrl ( "admin/index" ,array( "type" => 2 )),
                     
    "Tasks" => Yii :: app ()-> controller -> createUrl ( "admin/index" ,array( "type" => 1 )),
                      
    "Operations" => Yii :: app ()-> controller -> createUrl ( "admin/index" ,array( "type" => 0 ))
                     ),
                );
    ?>




    <?php $this -> widget ( 'zii.widgets.grid.CGridView' , array(
        
    'dataProvider' => $dataProvider ,
        
    'id' => "roles-grid-id" ,

        
    'columns' =>array(
                array(
                    
    'class' => 'CCheckBoxColumn' ,
                    
    'name' => "name" ,
                    
    'checkBoxHtmlOptions' =>array( "class" => "right_item_ckbx" , "name" => "roles[]" ),
                    
    'selectableRows' => "10"
                    
    ),
                array(
                    
    "name" => "name" ,
                    
    "type" => "raw" ,
                    
    "value" => '$data->getTreeRepeater()." ".$data->getViewLink();'
                    
    ),
                array(
                    
    "name" => "Users" ,
                    
    "type" => "raw" ,
                    
    "value" => '0;'
                    
    ),
                array(
                    
    "name" => "Tasks" ,
                    
    "type" => "raw" ,
                    
    "value" => 'CHtml::link($data->childCount(1),
                                                        Yii::app()->controller->createUrl("index",
                                                                                            array("type"=>1,
                                                                                            "pid"=>$data->name)))'
    ,
                    
    'visible' => $type > 0
                    
    ),
                array(
                    
    "name" => "Operations" ,
                    
    "type" => "raw" ,
                    
    "value" => 'CHtml::link($data->childCount(0),
                                                        Yii::app()->controller->createUrl("index",
                                                                                            array("type"=>0,
                                                                                            "pid"=>$data->name)))'
    ,
                    
    'visible' => $type > 0
                    
    )
                    
                )
    )); 
    ?>


    Fehlermeldung
    Code:
    
    Cannot modify header information - headers already sent by (output started at /homepages/20/d327830284/htdocs/app/protected/modules/rights/components/dataproviders/RNestedDataProvider.php:46)
    
    /homepages/20/d327830284/htdocs/framework/web/CHttpRequest.php(1049)
    
    1037 }
    1038 
    1039 /**
    1040 * Sends a cookie.
    1041 * @param CHttpCookie $cookie cookie to be sent
    1042 */
    1043 protected function addCookie($cookie)
    1044 {
    1045 $value=$cookie->value;
    1046 if($this->_request->enableCookieValidation)
    1047 $value=Yii::app()->getSecurityManager()->hashData(serialize($value));
    1048 if(version_compare(PHP_VERSION,'5.2.0','>='))
    [B]1049 setcookie($cookie->name,$value,$cookie->expire,$cookie->path,$cookie->domain,$cookie->secure,$cookie->httpOnly);[/B]
    1050 else
    1051 setcookie($cookie->name,$value,$cookie->expire,$cookie->path,$cookie->domain,$cookie->secure);
    1052 }
    1053 
    1054 /**
    1055 * Deletes a cookie.
    1056 * @param CHttpCookie $cookie cookie to be deleted
    1057 */
    1058 protected function removeCookie($cookie)
    1059 {
    1060 if(version_compare(PHP_VERSION,'5.2.0','>='))
    1061 setcookie($cookie->name,null,0,$cookie->path,$cookie->domain,$cookie->secure,$cookie->httpOnly);
    
    Stack Trace
    #0 
    +
     /homepages/20/d327830284/htdocs/framework/web/CHttpRequest.php(1049): setcookie("YII_CSRF_TOKEN", "5c8e7d1cd20f14152ec90a442364f56affc7d68ds:40:"60fc34a1fcb2e05b58...", 0, "/", ...)
    #1 
    +
     /homepages/20/d327830284/htdocs/framework/web/CHttpRequest.php(1016): CCookieCollection->addCookie(CHttpCookie)
    #2 
    +
     /homepages/20/d327830284/htdocs/framework/web/CHttpRequest.php(882): CCookieCollection->add("YII_CSRF_TOKEN", CHttpCookie)
    #3 
    +
     /homepages/20/d327830284/htdocs/framework/base/CComponent.php(112): CHttpRequest->getCsrfToken()
    #4 
    -
     /homepages/20/d327830284/htdocs/app/protected/modules/rights/views/admin/index.php(17): CComponent->__get("csrfToken")
    
    12 array("type"=>$type))),
    13 "edit"=>array("url"=>Yii::app()->controller->createUrl("admin/update")),
    14 "delete"=>array("url"=>Yii::app()->controller->createUrl("delete"),
    15 "ajax"=>array(
    16 "data"=>array(Yii::app()->request->csrfTokenName =>
    [B]17 Yii::app()->request->csrfToken))[/B]
    18 ),
    19 "cancel"=>array("url"=>Yii::app()->controller->createUrl("admin/index")),
    20 ),
    21 'menu'=>array("Roles"=>Yii::app()->controller->createUrl("admin/index",array("type"=>2)),
    22 "Tasks"=>Yii::app()->controller->createUrl("admin/index",array("type"=>1)),
    
    #5 
    +
     /homepages/20/d327830284/htdocs/framework/web/CBaseController.php(127): require("/homepages/20/d327830284/htdocs/app/protected/modules/rights/vie...")
    #6 
    +
     /homepages/20/d327830284/htdocs/framework/web/CBaseController.php(96): CBaseController->renderInternal("/homepages/20/d327830284/htdocs/app/protected/modules/rights/vie...", array("dataProvider" => RNestedDataProvider, "type" => 2), true)
    #7 
    +
     /homepages/20/d327830284/htdocs/framework/web/CController.php(871): CBaseController->renderFile("/homepages/20/d327830284/htdocs/app/protected/modules/rights/vie...", array("dataProvider" => RNestedDataProvider, "type" => 2), true)
    #8 
    +
     /homepages/20/d327830284/htdocs/framework/web/CController.php(783): CController->renderPartial("index", array("dataProvider" => RNestedDataProvider, "type" => 2), true)
    #9 
    -
     /homepages/20/d327830284/htdocs/app/protected/modules/rights/controllers/AdminController.php(168): CController->render("index", array("dataProvider" => RNestedDataProvider, "type" => 2))
    
    163 ));
    164 
    165 $this->render('index',array(
    166 'dataProvider'=>$dataProvider,
    167 'type'=>$type
    [B]168 ));[/B]
    169 }
    170 
    171 /**
    172 * Manages all models.
    173 */
    
    #10 
     unknown(0): AdminController->actionIndex(null, null)
    #11 
    +
     /homepages/20/d327830284/htdocs/framework/web/actions/CAction.php(107): ReflectionMethod->invokeArgs(AdminController, array(null, null))
    #12 
    +
     /homepages/20/d327830284/htdocs/framework/web/actions/CInlineAction.php(48): CAction->runWithParamsInternal(AdminController, ReflectionMethod, array())
    #13 
    +
     /homepages/20/d327830284/htdocs/framework/web/CController.php(309): CInlineAction->runWithParams(array())
    #14 
    +
     /homepages/20/d327830284/htdocs/framework/web/CController.php(287): CController->runAction(CInlineAction)
    #15 
    +
     /homepages/20/d327830284/htdocs/framework/web/CController.php(266): CController->runActionWithFilters(CInlineAction, array())
    #16 
    +
     /homepages/20/d327830284/htdocs/framework/web/CWebApplication.php(276): CController->run("index")
    #17 
    +
     /homepages/20/d327830284/htdocs/framework/web/CWebApplication.php(135): CWebApplication->runController("rights/admin/index")
    #18 
    +
     /homepages/20/d327830284/htdocs/framework/base/CApplication.php(162): CWebApplication->processRequest()
    #19 
    -
     /homepages/20/d327830284/htdocs/app/index.php(28): CApplication->run()
    
    23 $configFile = YII_DEBUG ? 'dev.php' : 'production.php';
    24 
    25 
    26 require_once($yii);
    27 
    [B]28 Yii::createWebApplication($config.$configFile)->run();[/B]
    
    
     
  8. 11. April 2012
    AW: Yii...header already send Problem

    Der StackTrace ist leider nicht hilfreich in diesem Fall da man nicht sehen kann wo die Ausgabe stattfindet.

    Wenn du keine offensichtlichen Ausgaben via "echo/print" "print_r" oder "var_dump" gemacht hast dann checke im ersten Schritt einmal ob du Zeilenumbrüche vor (oder je nach Datei auch nach) den "<?php" und "?>"-Tags hast, diese zählen nämlich auch als "Ausgabe"...

    Also:
    Richtig:
    Code:
    <?php
    // Hier dein Code
    ?>
    Falsch:
    Code:
    
    <?php
    // Code
    ?>
    
    Wenn du da auch nichts findest checke in einem zusätzlichen Schritt die Zeichenkodierung deiner Dateien. Öffnest du die Dateien mit einem Editor der die falsche Zeichenkodierung (oder auch UNIX bzw. Windows Format) verwendet, dann kann es unter Umständen vorkommen dass ein Zeilenumbruch nicht als solcher dargestellt wird.
    Beispiel: Wenn du eine Datei welche im Linux Format gespeichert wurde - Zeilenumbrüche werden dort mit dem Charakter \n dargstellt - in einem Editor öffnest welcher das Windows Format erwartet, dann zeigt dir dieser einfach den Text in einer Zeile an (ohne Umbrüche)...
    Das könnte dazu führen dass du einen Zeilenumbruch am Anfang einer Datei (z.B. index.php) nicht erkennst weil er als "\n" dargstellt wird, aber vom Editor nicht als Zeilenumbruch erkannt wird.

    // Edit:
    PHP hat dir doch schon den Ursprung allen Übels ausgespuckt:
    /homepages/20/d327830284/htdocs/app/protected/modules/rights/components/dataproviders/RNestedDataProvider.php:46
    Hier vielleicht ein Zeilenumbruch nach "?>"?... Poste doch einmal die Datei.
     
  9. 11. April 2012
    AW: Yii...header already send Problem

    Der Übeltäter ist das Rights-Module welches du nutzt, daher würde es mich interesseren was sich dort in der Datei RNestedDataProvider.php an Zeile 46 befindet.
     
  10. 11. April 2012
    AW: Yii...header already send Problem

    Hier die Datei

    PHP:

    <?php

    class  RNestedDataProvider  extends  CActiveDataProvider
    {
        

        
    private  $_authorizer ;
        
        

        
    public function  __construct ( $userClass , $config =array())
        {
        
            
    parent :: __construct ( $userClass $config );
            
            
    $this -> _authorizer  Rights :: module ()-> getAuthorizer ();
        }
        
        

        
    protected function  fetchData ()
        {
            
    $items  =      $this -> _authorizer -> getAuthItems ();
            foreach(
    $items  as  $model  )
            {
                
    $data [] =  $this -> _authorizer -> attachAuthItemBehavior ( $model );
            }
            return 
    $data ;
        }
    }
    ?>





    jedem Element wird ein Behavior angehängt
    PHP:
    <? php

    class  RAuthItemBehavior  extends  CBehavior
    {
        

        
    public  $userId ;
        

        
    public  $parent ;
        

        
    public  $childCount ;

        

        
    public function  __construct ( $userId = null CAuthItem $parent = null )
        {
            
    $this -> userId  $userId ;
            
    $this -> parent  $parent ;
        }

        

        
    public function  getNameText ()
        {
        
            return (
    Rights :: module ()-> displayDescription === true  &&  $this -> owner -> description !== null ) ?  $this -> owner -> description  $this -> owner -> name ;
        }

        

        
    public function  getNameLink ()
        {
            return 
    CHtml :: link ( $this -> getNameText (), array(
                
    'update' ,
                
    'id' => urlencode ( $this -> owner -> name ),
            ));
        }
        
        
        

        
    public function  getViewLink ()
        {
            return 
    CHtml :: link ( $this -> getNameText (), array(
                
    'admin/view' ,
                
    'id' => urlencode ( $this -> owner -> name ),
            ));
        }
        
        

        
    public function  getGridNameLink ()
        {
            
            
    $markup  CHtml :: link ( $this -> owner -> name , array(
                
    'authItem/update' ,
                
    'name' => urlencode ( $this -> owner -> name ),
            ));

            
    $markup  .=  $this -> childCount ();
            
    $markup  .=  $this -> sortableId ();

            return 
    $markup ;
        }

        

        
    public function  childCount ( $type = null )
        {
            
    //wenn kein ItemTyp angegeben ist
            
    if( $type === null  &&  $this -> childCount == null  )
            {
                
                
    $this -> childCount  = ( $this -> owner -> rgt - $this -> owner -> lft - 1 )/ 2 ;
            }elseif(
    $type  &&  $this -> childCount === null )
            {    
            
                    
    $this -> childCount  count ( $this -> owner -> getNodeChildren ( $this -> owner -> lft , $this -> owner -> rgt , $type ));
            }
                
            return 
    $this -> childCount > ' [ <span class="child-count">' . $this -> childCount . '</span> ]'  '' ;
        }

        

        
    public function  sortableId ()
        {
             return 
    ' <span class="auth-item-name" style="display:none;">' . $this -> owner -> name . '</span>' ;
        }

        

        
    public function  getTypeText ()
        {
            return 
    Rights :: getAuthItemTypeName ( $this -> owner -> type );
        }
        
        

        
    public function  getTreeRepeater ()
        {
            return 
    str_repeat ( "&ndash;" , $this -> level );
        }

        

        
    public function  getDeleteOperationLink ()
        {
             
    CHtml :: linkButton ( Rights :: t ( 'core' 'Delete' ), array(
                
    'submit' =>array( 'authItem/delete' 'name' => urlencode ( $this -> owner -> name )),
                
    'confirm' => Rights :: t ( 'core' 'Are you sure you want to delete this operation?' ),
                
    'class' => 'delete-link' ,
                
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
            ));
        }

        

        
    public function  getDeleteTaskLink ()
        {
            return 
    CHtml :: linkButton ( Rights :: t ( 'core' 'Delete' ), array(
                
    'submit' =>array( 'authItem/delete' 'name' => urlencode ( $this -> owner -> name )),
                
    'confirm' => Rights :: t ( 'core' 'Are you sure you want to delete this task?' ),
                
    'class' => 'delete-link' ,
                
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
            ));
        }

        

        
    public function  getDeleteRoleLink ()
        {
            
    // We do not want to show the delete link for the superuser role.
            
    if(  $this -> owner -> name !== Rights :: module ()-> superuserName  )
            {
                return 
    CHtml :: linkButton ( Rights :: t ( 'core' 'Delete' ), array(
                    
    'submit' =>array( 'authItem/delete' 'name' => urlencode ( $this -> owner -> name )),
                    
    'confirm' => Rights :: t ( 'core' 'Are you sure you want to delete this role?' ),
                    
    'class' => 'delete-link' ,
                    
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
                ));
            }
        }

        

        
    public function  getRemoveParentLink ()
        {
            return 
    CHtml :: linkButton ( Rights :: t ( 'core' 'Remove' ), array(
                
    'submit' =>array( 'authItem/removeChild' 'name' => urlencode ( $this -> owner -> name ),  'child' => urlencode ( $this -> parent -> name )),
                
    'class' => 'remove-link' ,
                
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
            ));
        }

        

        
    public function  getRemoveChildLink ()
        {
            return 
    CHtml :: linkButton ( Rights :: t ( 'core' 'Remove' ), array(
                
    'submit' =>array( 'authItem/removeChild' 'name' => urlencode ( $this -> parent -> name ),  'child' => urlencode ( $this -> owner -> name )),
                
    'class' => 'remove-link' ,
                
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
            ));
        }

        

        
    public function  getRevokeAssignmentLink ()
        {
            return 
    CHtml :: linkButton ( Rights :: t ( 'core' 'Revoke' ), array(
                
    'submit' =>array( 'assignment/revoke' 'id' => $this -> userId 'name' => urlencode ( $this -> owner -> name )),
                
    'class' => 'revoke-link' ,
                
    'csrf' => Yii :: app ()-> request -> enableCsrfValidation ,
            ));
        }
        
        

        
    public function  getRevokePermissionLink ( CAuthItem $role )
        {
            
    $csrf  Rights :: getDataCsrf ();
            
            return 
    CHtml :: link ( Rights :: t ( 'core' 'Revoke' ),  '#' , array(
                
    'onclick' => "
                    jQuery.ajax({
                        type:'POST',
                        url:'"
    . Yii :: app ()-> controller -> createUrl ( 'authItem/revoke' , array(
                            
    'name' => urlencode ( $role -> name ), 
                            
    'child' => urlencode ( $this -> owner -> name ),
                        )).
    "',
                        data:{ ajax:1 
    $csrf  },
                        success:function() {
                            $('#permissions').load('"
    . Yii :: app ()-> controller -> createUrl ( 'authItem/permissions' ). "', { ajax:1  $csrf  });
                        }
                    });

                    return false;                
                "
    ,
                
    'class' => 'revoke-link' ,
            ));
        }

        

        
    public function  getAssignPermissionLink ( CAuthItem $role )
        {
            
    $csrf  Rights :: getDataCsrf ();
            
            return 
    CHtml :: link ( Rights :: t ( 'core' 'Assign' ),  '#' , array(
                
    'onclick' => "
                    jQuery.ajax({
                        type:'POST',
                        url:'"
    . Yii :: app ()-> controller -> createUrl ( 'authItem/assign' , array(
                            
    'name' => urlencode ( $role -> name ), 
                            
    'child' => urlencode ( $this -> owner -> name ),
                        )).
    "',
                        data:{ ajax:1 
    $csrf  },
                        success:function() {
                            $('#permissions').load('"
    . Yii :: app ()-> controller -> createUrl ( 'authItem/permissions' ). "', { ajax:1  $csrf  });
                        }
                    });

                    return false;                
                "
    ,
                
    'class' => 'assign-link' ,
            ));
        }
        
        

        
    public function  getInheritedPermissionText ( $parents $displayType = false )
        {
            
    $items  = array();
            foreach( 
    $parents  as  $itemName => $item  )
            {
                
    $itemMarkup  $item -> getNameText ();

                if( 
    $displayType === true  )
                    
    $itemMarkup  .=  ' (' . Rights :: getAuthItemTypeName ( $item -> type ). ')' ;

                
    $items [] =  $itemMarkup ;
            }

            return 
    '<span class="inherited-item" title="' . implode ( '<br />' $items ). '">' . Rights :: t ( 'core' 'Inherited' ). ' *</span>' ;
        }
    }



     
  11. 12. April 2012
    AW: Yii...header already send Problem

    Irgendetwas kann da nicht stimmen, deine Datei hat nur 37 Zeilen, aber in der Zeile 46 wird eine Ausgabe gemacht, merkst was?
     
  12. 12. April 2012
    AW: Yii...header already send Problem

    Ja ich verstehe was du meinst..aber kann es denn nicht daran liegen, dass dem ganzen nicht behaviors angehängt werden??
     
  13. 12. April 2012
    AW: Yii...header already send Problem

    das problem ist, dass du NACH ?> noch etliche leerzeilen stehen hast, die dann natürlich eine ausgabe erzeugen.

    als tipp: wenn du nur php-code in einer datei stehen hast oder die datei mit php-code endet, lass das schließende ?> weg. dann konsumiert der php-interpreter alle leerzeichen/zeilen am ende der datei ohne diese auszugeben.

    falsch:
    Code:
    <?php
    
    // code ....
    
    ?>
     
    [COLOR="White"].[/COLOR]
    
    richtig:
    Code:
    <?php
    
    // code ....
    
     
     
    [COLOR="White"].[/COLOR]
    
     
  14. 12. April 2012
    AW: Yii...header already send Problem

    Manchmal frage ich mich ja wieso ich überhaupt versuche anderen Leuten Ratschläge zu geben wenn diese anscheinend nichtmal gelesen werden :/
     
  15. 12. April 2012
    AW: Yii...header already send Problem

    Soo..hab jetzt das "?>" entfernt und es geht....:angry:

    Leute danke euch...
     
  16. 12. April 2012
    AW: Yii...header already send Problem

    dann gib Coksnuss n bier aus

    -> erledigt.
     
  17. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.