How to get reference for namespace Microsoft.WebPages.Compilation - asp.net-mvc-3

I am developing MVC 3 web application. According to some articles, we can register global namespaces by CodeGeneratorSettings.AddGlobalImport function.Here is one link.
But the problem is I can not use CodeGeneratorSettings class in my app, can not find any references for it. Have it already been depreciated?
I have Webmatrix 1.0 installed, but it does not help.
Any help is appreicated.

The method has been moved to the following namespace
System.Web.WebPages.Razor.WebCodeRazorHost.AddGlobalImport("Your namespace");
I would recommend using the web.config method however as there would only be one place in your code to add/remove namespaces.

Related

Is it possible to rename Teams in Laravel Jetstream?

In the old Laravel Spark (now Spark Classic) you could utilise a configuration method Spark::prefixTeamsAs('bands'); a new project I'm working on uses the new Laravel Spark which is now more of a billing conduit and allows team management to be taken care of by Laravel Jetstream. Does Laravel Jetstream support referring to teams by other labels?
Jetstream doesn't have built-in support for renaming Teams. I worked around this by publishing the views and renaming Team in the applicable view files. I haven't overrode the routing yet, so my Teams related paths still have team in the URL.
I looked to see if there was a built in feature and found a lot of people like you looking for a solution with answers with terrible solutions. Here is what I did that works better than all the solutions provided. The only downside/upside is the functions of JetStream will obviously still call it Teams. I removed my default built App\Models\Team and replaced it with in my case Projects and overrided the default table naming convention, for you can be Bands:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Jetstream\Events\TeamCreated;
use Laravel\Jetstream\Events\TeamDeleted;
use Laravel\Jetstream\Events\TeamUpdated;
use Laravel\Jetstream\Team as JetstreamTeam;
class Bands extends JetstreamTeam
{
use HasFactory;
public $table="bands";
}

Laravel View Component support on view namespace

By default you can add components to resources/views/components and use them using x- prefix with blade files. I registerd a view namespace which is located on different directory and i want the components directory in that namespace to be discovered as well.
Is there a way on laravel 7 to add additional directory to discover?
The instructions for Manually Registering Package Components in the official component documentation at https://laravel.com/docs/master/blade#components should give you the functionality you are after by registering your components manually in a service provider.
That said, it might be worth thinking carefully about why you want to deviate from the default folder.
I hope this helps!

Does CodeIgniter have plugins / extensions / modules?

I am looking at few PHP frameworks and noticed that they all offer re-usable, community-contributed code in various forms:
-Symfony 2 (bundles): http://knpbundles.com/
-Zend Framework 2 (modules): http://modules.zendframework.com/
-CakePHP (plugins): http://plugins.cakephp.org/
-Yii Framework (extensions): http://www.yiiframework.com/extensions/
but I can't find anything for Code Igniter (I saw in this SO post that Code Igniter used to have plugins that were replaced by helpers, but when I google for "Code Igniter helpers" or "Code Igniter plugins" I can't find any repositories).
What is the name for Code Igniter community-contributed and reusable libraries? Can you share a link to their main repository?
You can have a look at sparks and HMVC.
You didn't find this? https://github.com/EllisLab/CodeIgniter/wiki/_pages
Also checkout their forums too.
The previous name plugin within codeigniter didn't really mean the same thing as plugins for Cake or Bundles for Symfony
check this one awesome codeigniter there is a list of different resources for CodeIgniter

base controller zend framework 2

I wonder if someone here can help, I am just starting with Zend Framework 2 and I am find it slightly daunting to get a project started off properly..
I am trying to create a base controller that I can be extended from. I am currently using the Zend Framework 2 skeleton application.
I have created a Resources folder in vendor/zendframework/zendframework/library. Within the the Resources folder, I have a Controllers folder which houses a BaseController.php file.
How do I get my project to autoload the BaseController in the Resources folder for it to be available through out the entire site?
Any help will be most appreciated.
Thanks
You shouldn't need to create a base controller, ZF2 already provides a number of base controllers for you, such as the RestController and the AbstractActionController
http://framework.zend.com/manual/2.0/en/modules/zend.mvc.controllers.html
If you are going to create a base controller, create you own module and put it in the vendors directory.
You should never need to go into third party modules and modify code as you should be able to inherit and extend the classes that are provided by such libraries

Overriding Joomla core component file

I am trying to override the com_content/views/article/view.html.php file in joomla using the instructions given in this page
It says I have to create a folder named 'code' in base directory and create the same directory structure. I tried it , but its not working. Can someone confirm whether its working.
Where should I create code folder? Is it on root of joomla installations?
PS- The edit is working correctly when applied on core file
You can override (nearly) any class in Joomla, if your class with the same name is loaded first. To ensure that, you need to create a system plugin.
Here is an example for root/components/com_content/views/article/view.html.php:
class plgSystemOverride extends JPlugin
{
public function onAfterRoute()
{
JLoader::register('ContentViewArticle', 'path/to/override.php', true);
}
}
CAVEAT: Overriding a core class can lead to problems with other extensions, if you're not very careful. For views, though, any interferrence with other extensions is less likely.
You can't override component controllers, models and views in core Joomla! without using a 3rd party plugin.
The plugin you need can be found here: http://extensions.joomla.org/extensions/style-a-design/templating/15611
The code folder then goes into your Joomla root unless you're overriding a back-end view in which case it goes into /administrator
Hope this helps :)
You can use the Class Overrider Plugin http://extensions.joomla.org/extensions/tools/development-tools/23994
just adding some simple human reading commands

Resources