Overriding core-file in a package

Permalink 1 user found helpful
Hi there,
i read a lot of 'How tos' and 'Forum entrys' but i not found an answer about my following example.

It is possible to override the

concrete/core/modals/user_list.php

directly with

my_package_name/modals/user_list.php

or on similiar way.

This refers to all core-files.

Thanks a lot

 
cjramki replied on at Permalink Reply
cjramki
Core is used for core functionality and should never be modified.

It is nearly always accessed though wrapper classes. For example

class xxx_controller extends core_xxx_controller{
}


This enables you to override a core class by extending it rather than having to replace all of it (like you used to have to do in older versions of c5).

You still need to make the overrides in your root level directories, or in a package by calling overrideCoreByPackag(). But rather than copying an entire core class to modify just a few lines, you can simply extend the core class and just declare the methods you are changing.
this is the answer of JonhtheFish...
http://www.concrete5.org/community/forums/customizing_c5/what-about...
mhawke replied on at Permalink Best Answer Reply
mhawke
It's not polite to steal other users answers and post them as your answers:

http://www.concrete5.org/community/forums/customizing_c5/what-about...
mhawke replied on at Permalink Reply
mhawke
Thank you for adding a reference to JohntheFish's answer.