Mentions légales

Now, a few notes on helper paths and prefixes. First, the path and class prefix need not have a one-to-one relationship as might your other library code; hat is important, however, is that all classes in that directory have that class prefix. Zend_View will merely check to see if a class file with the helper name xists in that directory, and, if not, move to the next directory in the stack. This means

 

you can group your helpers in one or more directories, then register hese paths with the view object once — and have access to all helpers in those paths. Second, we mentioned earlier that you need class prefixes. The reason is to prevent collisions between libraries and standard class names. This also allows you to extend existing helpers to provide additional functionality (e.g., the partialLoop() helper extends partial()). Third, building on this last point, helper paths, as is the case with all plugin paths in ZF, operate as style="border-bottom: 1px dotted black">LIFO stacks. his allows you to create helpers with your own class prefix and have them override helpers of the same name with different prefixes. In other words, it llows you to override the behavior of the standard helpers shipped with ZF. Building on this last point, let’s say you don’t like how the formHidden() view helper works; you want it to include an extra class always — so that you can asily pull all hidden elements using javascript to perform an operation on them. Overall, the base functionality is fine, so you might do something like this ANow, a few notes on helper paths and prefixes. First, the path and class prefix need not have a one-to-one relationship as might your other library code; what is important, however, is that all classes in that directory have that class prefix. Zend_View will merely check to see if a class file with the helper name exists in that directory, and, if not, move to the next directory in the stack. This means you can group your helpers in one or more directories, then register these paths with the view object once — and have access to all helpers in those paths. Second, we mentioned earlier that you need class prefixes. The reason is to prevent collisions between libraries and standard class names. This also allows you to extend existing helpers to provide additional functionality (e.g., the partialLoop() helper extends partial()). Third, building on t

 

his last point, helper paths, as is the case with all plugin paths in ZF, operate as style="border-bottom: 1px dotted black">LIFO stacks. This allows you to create helpers with your own class prefix and have them override helpers of the same name with different prefixes. In other words, it allows you to override the behavior of the standard helpers shipped with ZF. Building on this last point, let’s say you don’t like how the formHidden() view helper works; you want it to include an extra class always — so that you can easily pull all hidden elements using javascript to perform an operation on them. Overall, the base functionality is fine, so you might do something like this:Now, a few notes on helper paths and prefixes. First, the path and class prefix need not have a one-to-one relationship as might your other library code; what is important, however, is that all classes in that directory have that class prefix. Zend_View will merely check to see if a class file with the helper name exists in that directory, and

 

, if not, move to the next directory in the stack. This means you can group your helpers in one or more directories, then register these paths with the view object once — and have access to all helpers in those paths. Second, we mentioned earlier that you need class prefixes. The reason is to prevent collisions between libraries and standard class names. This also allows you to extend existing helpers to provide additional functionality (e.g., the partialLoop() helper extends partial()). Third, building on this last point, helper paths, as is the case with all plugin paths in ZF, operate as style="border-bottom: 1px dotted black">LIFO stacks. This allows you to create helpers with your own class prefix and have them override helpers of the same name with different prefixes. In other words, it allows you to override the behavior of the standard helpers shipped with ZF. Building on this last point, let’s say you don’t like how the formHidden() view helper works; you want it to include an extra class always — so that you can easily pull all hidden elements using javascript to perform an operation on them. Overall, the base functionality is fine, so you might do something like this: